The NetBSD Project

CVS log for src/sys/sys/mbuf.h

[BACK] Up to [cvs.NetBSD.org] / src / sys / sys

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.239 / (download) - annotate - [select for diffs], Mon Jan 22 21:15:02 2024 UTC (8 weeks ago) by jdolecek
Branch: MAIN
CVS Tags: triaxx-drm, HEAD
Changes since 1.238: +2 -2 lines
Diff to previous 1.238 (colored)

fix M_CSUM_BITS bitfield for M_CSUM_BLANK - \37 is the bit before \40

noticed by rillig@ thanks

Revision 1.238 / (download) - annotate - [select for diffs], Wed Apr 12 06:48:08 2023 UTC (11 months, 1 week ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Changes since 1.237: +3 -1 lines
Diff to previous 1.237 (colored)

mbuf(9): New m_get_n, m_gethdr_n.

m_get_n(how, type, alignbytes, nbytes) returns an mbuf with no packet
header having space for nbytes, with an internal buffer pointer
aligned by alignbytes (typically ETHER_ALIGN or similar, if not
zero).

m_gethdr_n(how, type, alignbytes, nbytes) does the same but for an
mbuf with a packet header.

These return NULL on failure, which can happen either:
(a) because how is M_DONTWAIT and allocating memory would sleep, or
(b) because alignbytes + nbytes > MCLBYTES.

On exit, m_len is set to nbytes, as is m_pkthdr.len for m_gethdr_n.

These should be used to systematically replace all calls to m_get,
m_gethdr, MGET, MGETHDR, and m_getcl.  Most calls to m_clget and
MCLGET will probably evaporate as a consequence.

Proposed on tech-net last year:
https://mail-index.netbsd.org/tech-net/2022/07/16/msg008285.html

Revision 1.237 / (download) - annotate - [select for diffs], Fri Dec 16 08:42:55 2022 UTC (15 months ago) by msaitoh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.236: +2 -1 lines
Diff to previous 1.236 (colored)

Add new "kern.mbuf.nmbclusters_limit" sysctl.

 - Used to know the upper limit of nmbclusters.
 - It's read only.

Revision 1.236 / (download) - annotate - [select for diffs], Tue Nov 15 10:47:39 2022 UTC (16 months ago) by roy
Branch: MAIN
Changes since 1.235: +2 -1 lines
Diff to previous 1.235 (colored)

arp: Validate ARP source hardware address matches Ethernet source

RFC 5227 section 1.1 states that for a DaD ARP probe the sender hardware
address must match the hardware address of the interface sending the
packet.

We can now verify this by checking the mbuf tag PACKET_TAG_ETHERNET_SRC.

This fixes an obsure issue where an old router was sending out bogus
ARP probes.

Thanks to Ryo Shimizu <ryo@nerv.org> for the re-implementation.

Revision 1.235 / (download) - annotate - [select for diffs], Tue Nov 15 09:13:43 2022 UTC (16 months ago) by roy
Branch: MAIN
Changes since 1.234: +3 -6 lines
Diff to previous 1.234 (colored)

Revert prior.

Revision 1.234 / (download) - annotate - [select for diffs], Mon Nov 14 10:15:08 2022 UTC (16 months ago) by roy
Branch: MAIN
Changes since 1.233: +3 -3 lines
Diff to previous 1.233 (colored)

Adjust comment for new sizes.

Thanks to Kengo NAKAHARA <k-nakahara@iij.ad.jp>

Revision 1.233 / (download) - annotate - [select for diffs], Mon Nov 14 09:23:42 2022 UTC (16 months ago) by roy
Branch: MAIN
Changes since 1.232: +4 -1 lines
Diff to previous 1.232 (colored)

net: Store a pointer to the Layer 2 Sender Hardware address in mbuf

The BSD networking stack is designed around passing a mbuf down the chain
and each layer removes the part it's interested in before passing it to
the next. This makes it easy for each layer to do it's work,
but non trivial to work backwards.

As such we now store a pointer to the Senders Hardware address in the
mbuf packet header so that protocols can perform any required validation.

Revision 1.232 / (download) - annotate - [select for diffs], Fri Feb 19 14:51:59 2021 UTC (3 years ago) by christos
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.231: +12 -6 lines
Diff to previous 1.231 (colored)

- Make ALIGNED_POINTER use __alignof(t) instead of sizeof(t). This is more
  correct because it works with non-primitive types and provides the ABI
  alignment for the type the compiler will use.
- Remove all the *_HDR_ALIGNMENT macros and asserts
- Replace POINTER_ALIGNED_P with ACCESSIBLE_POINTER which is identical to
  ALIGNED_POINTER, but returns that the pointer is always aligned if the
  CPU supports unaligned accesses.
[ as proposed in tech-kern ]

Revision 1.231 / (download) - annotate - [select for diffs], Wed Feb 17 22:32:04 2021 UTC (3 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.230: +4 -3 lines
Diff to previous 1.230 (colored)

- pass the alignment instead of the mask (as Roy asked and to match the
  other macro)
- use alignof to determine that alignment and CTASSERT what we expect
- remove unused macros

Revision 1.230 / (download) - annotate - [select for diffs], Mon Feb 15 09:29:56 2021 UTC (3 years, 1 month ago) by kre
Branch: MAIN
Changes since 1.229: +2 -2 lines
Diff to previous 1.229 (colored)


Don't compare int against size_t .. since mbuf lengths should never
be negative, cast it from int to size_t (rather than the other way
around).   Hopefully fix build.

Revision 1.229 / (download) - annotate - [select for diffs], Mon Feb 15 00:44:09 2021 UTC (3 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.228: +8 -8 lines
Diff to previous 1.228 (colored)

remove _ prefix from args

Revision 1.228 / (download) - annotate - [select for diffs], Sun Feb 14 20:58:35 2021 UTC (3 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.227: +12 -1 lines
Diff to previous 1.227 (colored)

- centralize header align and pullup into a single inline function
- use a single macro to align pointers and expose the alignment, instead
  of hard-coding 3 in 1/2 the macros.
- fix an issue in the ipv6 lt2p where it was aligning for ipv4 and pulling
  for ipv6.

Revision 1.227 / (download) - annotate - [select for diffs], Mon Apr 6 09:32:54 2020 UTC (3 years, 11 months ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Branch point for: thorpej-futex
Changes since 1.226: +3 -2 lines
Diff to previous 1.226 (colored)

define M_CSUM_BLANK, eventually to be used by xennet(4)/xvif(4) to offload
checksums to NIC hw

Revision 1.226 / (download) - annotate - [select for diffs], Sun Mar 15 23:14:41 2020 UTC (4 years ago) by thorpej
Branch: MAIN
Changes since 1.225: +3 -1 lines
Diff to previous 1.225 (colored)

Add and use a new function, mowner_init_owner(), that initializes an
MBUFTRACE mowner structure (so that providers of it don't have to
grovel the internals).

Revision 1.225 / (download) - annotate - [select for diffs], Thu Mar 5 15:18:55 2020 UTC (4 years ago) by riastradh
Branch: MAIN
Changes since 1.224: +1 -2 lines
Diff to previous 1.224 (colored)

Revert "Include opt_diagnostic.h for DIAGNOSTIC."

This did not do what I thought it did.  opt_diagnostic.h is only for
the unused _DIAGNOSTIC, which seems like an abortive attempt to
incrementally convert DIAGNOSTIC to an opt_*.h option rather than a
command-line option.

Revision 1.224 / (download) - annotate - [select for diffs], Thu Mar 5 08:08:33 2020 UTC (4 years ago) by riastradh
Branch: MAIN
Changes since 1.223: +2 -1 lines
Diff to previous 1.223 (colored)

Include opt_diagnostic.h for DIAGNOSTIC.

...at least, in header files, which may not have already included
libkern.h.

Revision 1.223 / (download) - annotate - [select for diffs], Sat Feb 29 16:59:00 2020 UTC (4 years ago) by mlelstv
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.222: +3 -3 lines
Diff to previous 1.222 (colored)

Follow FreeBSD and cast MLEN and MHLEN to int. mbuf length arithmtic is
done with signed integers and this avoids comparisons with different
signedness.

Revision 1.222 / (download) - annotate - [select for diffs], Mon Sep 23 08:04:35 2019 UTC (4 years, 5 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20191119, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.221: +4 -9 lines
Diff to previous 1.221 (colored)

Use M_BUFADDR to dedup code in M_LEADINGSPACE.

Revision 1.221 / (download) - annotate - [select for diffs], Wed Sep 18 16:18:12 2019 UTC (4 years, 6 months ago) by maxv
Branch: MAIN
Changes since 1.220: +16 -25 lines
Diff to previous 1.220 (colored)

Handle M_EXT with M_BUFADDR, and introduce M_BUFSIZE. Use them to dedup
code.

Revision 1.220 / (download) - annotate - [select for diffs], Sun Aug 25 16:38:20 2019 UTC (4 years, 6 months ago) by rmind
Branch: MAIN
Changes since 1.219: +2 -1 lines
Diff to previous 1.219 (colored)

Move PACKET_TAG_NPF where it belongs to.

Revision 1.219 / (download) - annotate - [select for diffs], Thu Jan 17 02:47:15 2019 UTC (5 years, 2 months ago) by knakahara
Branch: MAIN
CVS Tags: phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, netbsd-9-base, isaki-audio2-base, isaki-audio2
Branch point for: netbsd-9
Changes since 1.218: +3 -2 lines
Diff to previous 1.218 (colored)

Fix ipsecif(4) cannot apply input direction packet filter. Reviewed by ozaki-r@n.o and ryo@n.o.

Add ATF later.

Revision 1.218 / (download) - annotate - [select for diffs], Thu Dec 27 14:24:11 2018 UTC (5 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.217: +121 -123 lines
Diff to previous 1.217 (colored)

Style, use __nothing, and remove _M_ (unused, appears to be a typo). No
functional change.

Revision 1.217 / (download) - annotate - [select for diffs], Thu Dec 27 14:03:55 2018 UTC (5 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.216: +1 -7 lines
Diff to previous 1.216 (colored)

Remove M_COPY_PKTHDR, M_MOVE_PKTHDR, M_ALIGN and MH_ALIGN.

Revision 1.216 / (download) - annotate - [select for diffs], Sat Dec 22 13:55:56 2018 UTC (5 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1226
Changes since 1.215: +4 -23 lines
Diff to previous 1.215 (colored)

Move m_align() back into the kernel, and switch M_ALIGN and MH_ALIGN to it.
Forcing a distinction between M_ALIGN and MH_ALIGN is too bug-friendly and
serves no particular purpose.

Revision 1.215 / (download) - annotate - [select for diffs], Thu Nov 15 11:18:33 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1126
Changes since 1.214: +14 -14 lines
Diff to previous 1.214 (colored)

Reduce indentation level.

Revision 1.214 / (download) - annotate - [select for diffs], Thu Nov 15 10:56:30 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.213: +2 -3 lines
Diff to previous 1.213 (colored)

Remove the 'copy' argument from m_devget(), unused. While here rename
off0->off.

Revision 1.213 / (download) - annotate - [select for diffs], Thu Nov 15 10:23:56 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.212: +2 -2 lines
Diff to previous 1.212 (colored)

Remove the 't' argument from m_tag_find().

Revision 1.212 / (download) - annotate - [select for diffs], Thu Nov 15 10:06:07 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.211: +2 -6 lines
Diff to previous 1.211 (colored)

Simplify the mtag API:

 - Remove m_tag_init(), m_tag_first(), m_tag_next() and
   m_tag_delete_nonpersistent().

 - Remove the 't' argument from m_tag_delete_chain().

Revision 1.211 / (download) - annotate - [select for diffs], Fri Oct 12 05:49:38 2018 UTC (5 years, 5 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-1020
Changes since 1.210: +27 -3 lines
Diff to previous 1.210 (colored)

- Print TCP options. Some of them are not decoded yet (e.g. SACK).
- Print IP checksum and TCP checksum.
- When a packet length is shorter than a required size of the protocol, print
  both sizes.
- Make m_examine_xxx() functions global.
- Use bool instead of boolean_t.
- s/TRUE/true/, s/FALSE/false/
- KNF

Revision 1.210 / (download) - annotate - [select for diffs], Wed Aug 22 01:05:24 2018 UTC (5 years, 6 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0930, pgoyette-compat-0906
Changes since 1.209: +1 -13 lines
Diff to previous 1.209 (colored)

- Cleanup for dynamic sysctl:
  - Remove unused *_NAMES macros for sysctl.
  - Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
  use them on all m68k machines.

Revision 1.209 / (download) - annotate - [select for diffs], Thu Aug 9 17:43:54 2018 UTC (5 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.208: +1 -2 lines
Diff to previous 1.208 (colored)

Localify mcl_cache.

Revision 1.208 / (download) - annotate - [select for diffs], Tue Jul 17 05:52:07 2018 UTC (5 years, 8 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.207: +5 -1 lines
Diff to previous 1.207 (colored)

 Add /d(dump) and /v(verbose) modifiers to DDB's "show mbuf" command. Mainly
written by Hiroki SUENAGA. Currently, /v supports Ethernet, PPP, PPPoE, ARP,
IPv4, ICMP, IPv6, ICMPv6, TCP and UDP.

Revision 1.207 / (download) - annotate - [select for diffs], Fri Jun 1 08:56:00 2018 UTC (5 years, 9 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.206: +9 -15 lines
Diff to previous 1.206 (colored)

Rename

	M_CSUM_DATA_IPv6_HL -> M_CSUM_DATA_IPv6_IPHL
	M_CSUM_DATA_IPv6_HL_SET -> M_CSUM_DATA_IPv6_SET

Reduces the diff against IPv4. Also, clarify the definitions.

Revision 1.206 / (download) - annotate - [select for diffs], Fri May 18 18:52:17 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0521
Changes since 1.205: +26 -1 lines
Diff to previous 1.205 (colored)

IP6_EXTHDR_GET performs a basic mbuf operation, which has nothing to do
with IPv6. So declare an IP-independent M_REGION_GET, and make
IP6_EXTHDR_GET an alias to it.

Revision 1.205 / (download) - annotate - [select for diffs], Thu May 3 21:37:29 2018 UTC (5 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.204: +4 -2 lines
Diff to previous 1.204 (colored)

make mbuftypes always visible

Revision 1.204 / (download) - annotate - [select for diffs], Thu May 3 08:39:28 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.203: +1 -2 lines
Diff to previous 1.203 (colored)

Remove unused M_MAXCOMPRESS macro.

Revision 1.203 / (download) - annotate - [select for diffs], Thu May 3 08:14:29 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.202: +2 -2 lines
Diff to previous 1.202 (colored)

Fix comment, M_LOOP is not used for statistics, it's mostly used to avoid
recomputing the checksum when the packet is received on loopback.

Revision 1.202 / (download) - annotate - [select for diffs], Thu May 3 07:25:49 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.201: +2 -3 lines
Diff to previous 1.201 (colored)

Rename m_pkthdr_remove -> m_remove_pkthdr, to match the existing naming
convention, eg m_copy_pkthdr and m_move_pkthdr.

Revision 1.201 / (download) - annotate - [select for diffs], Thu May 3 07:01:08 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.200: +1 -4 lines
Diff to previous 1.200 (colored)

Remove m_copy completely.

Revision 1.200 / (download) - annotate - [select for diffs], Sun Apr 29 07:13:10 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0502
Changes since 1.199: +2 -2 lines
Diff to previous 1.199 (colored)

Remove references to m_copy in comments.

Revision 1.199 / (download) - annotate - [select for diffs], Sun Apr 29 06:52:55 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.198: +8 -6 lines
Diff to previous 1.198 (colored)

Add KASSERTs in the rcvif functions.

Revision 1.198 / (download) - annotate - [select for diffs], Fri Apr 27 19:06:48 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.197: +1 -29 lines
Diff to previous 1.197 (colored)

Remove unused debug code.

Revision 1.197 / (download) - annotate - [select for diffs], Fri Apr 27 16:32:03 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.196: +2 -6 lines
Diff to previous 1.196 (colored)

Remove unused ext_flags field in struct _m_ext_storage.

Also, simplify MEXTMALLOC, mbtypes[] doesn't exist anymore, but the code
still compiled correctly because "malloc" is a macro and the argument
was dropped.

Revision 1.196 / (download) - annotate - [select for diffs], Fri Apr 27 09:22:28 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.195: +1 -24 lines
Diff to previous 1.195 (colored)

Remove _MCLGET, merge its content into m_clget(). The code is slightly
modified to reduce the indentation level.

Revision 1.195 / (download) - annotate - [select for diffs], Fri Apr 27 08:51:26 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.194: +1 -2 lines
Diff to previous 1.194 (colored)

M_CLUSTER -> M_EXT_CLUSTER, and remove M_CLUSTER completely.

Revision 1.194 / (download) - annotate - [select for diffs], Fri Apr 27 07:53:07 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.193: +5 -5 lines
Diff to previous 1.193 (colored)

M_CLUSTER -> M_EXT_CLUSTER

Revision 1.193 / (download) - annotate - [select for diffs], Fri Apr 27 07:41:58 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.192: +1 -2 lines
Diff to previous 1.192 (colored)

Rename m_reclaim -> mb_drain, and localify.

Revision 1.192 / (download) - annotate - [select for diffs], Fri Apr 27 07:20:33 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.191: +3 -19 lines
Diff to previous 1.191 (colored)

Implement M_COPY_PKTHDR as a function, like m_move_pkthdr.

Revision 1.191 / (download) - annotate - [select for diffs], Fri Apr 27 06:56:21 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.190: +1 -3 lines
Diff to previous 1.190 (colored)

Move m_align and m_append into iee80211_netbsd.c. They are part of
net80211, and shouldn't be used outside.

Revision 1.190 / (download) - annotate - [select for diffs], Thu Apr 26 19:13:34 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.189: +2 -2 lines
Diff to previous 1.189 (colored)

Change MCLGET, so that it calls m_clget instead of doing the work in a
macro. Macros are inefficient when they contain too many instructions and
are used too often, because of cache coherency (and also register use).

This change saves 32KB of kernel .text.

Revision 1.189 / (download) - annotate - [select for diffs], Tue Apr 24 08:10:32 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.188: +6 -10 lines
Diff to previous 1.188 (colored)

Change/Improve the comments, so that the definitions fit one line.

Revision 1.188 / (download) - annotate - [select for diffs], Tue Apr 24 08:07:06 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.187: +3 -4 lines
Diff to previous 1.187 (colored)

Remove the M_AUTHIPDGM flag. It is equivalent to M_AUTHIPHDR, both
are set in IPsec-AH, and they are always handled together.

Revision 1.187 / (download) - annotate - [select for diffs], Sun Apr 15 17:26:39 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0422
Changes since 1.186: +12 -11 lines
Diff to previous 1.186 (colored)

clarify

Revision 1.186 / (download) - annotate - [select for diffs], Sun Apr 15 07:35:49 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0415
Changes since 1.185: +8 -1 lines
Diff to previous 1.185 (colored)

Introduce a m_verify_packet function, that verifies the mbuf chain of a
packet to ensure it is not malformed. Call this function in "points of
interest", that are the IPv4/IPv6/IPsec entry points. There could be more.

We use M_VERIFY_PACKET(m), declared under DIAGNOSTIC only.

This function should not be called everywhere, especially not in places
that temporarily manipulate (and clobber) the mbuf structure; once they're
done they put the mbuf back in a correct format.

Revision 1.185 / (download) - annotate - [select for diffs], Fri Apr 13 08:44:41 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.184: +2 -1 lines
Diff to previous 1.184 (colored)

Add a KASSERT, we want M_PKTHDR.

Revision 1.184 / (download) - annotate - [select for diffs], Fri Apr 13 07:36:11 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.183: +8 -11 lines
Diff to previous 1.183 (colored)

No, fix previous.

Revision 1.183 / (download) - annotate - [select for diffs], Fri Apr 13 07:30:46 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.182: +16 -9 lines
Diff to previous 1.182 (colored)

Improve comment.

Revision 1.182 / (download) - annotate - [select for diffs], Tue Apr 10 16:12:30 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.181: +1 -2 lines
Diff to previous 1.181 (colored)

Remove m_getclr. It is unused, confusing (vs m_clget), and is a weak
implementation (eg you can't request a zeroed pkthdr mbuf).

Revision 1.181 / (download) - annotate - [select for diffs], Tue Apr 10 15:27:35 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.180: +1 -2 lines
Diff to previous 1.180 (colored)

Localify m_ext_free.

Revision 1.180 / (download) - annotate - [select for diffs], Wed Mar 21 17:03:09 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322
Changes since 1.179: +2 -44 lines
Diff to previous 1.179 (colored)

Localify and remove unused prototypes.

Revision 1.179 / (download) - annotate - [select for diffs], Fri Mar 9 11:57:38 2018 UTC (6 years ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0315
Changes since 1.178: +3 -1 lines
Diff to previous 1.178 (colored)

Remove M_PKTHDR from secondary mbufs when reassembling packets.

This is a real problem, because I found at least one component that relies
on the fact that only the first mbuf has M_PKTHDR: far from here, in
m_splithdr, we don't update m->m_pkthdr.len if M_PKTHDR is found in a
secondary mbuf. (The initial intention there was to avoid updating
m_pkthdr.len twice, the assumption was that if M_PKTHDR is set then we're
dealing with the first mbuf.) Therefore, when handling fragmented IPsec
packets (in particular IPv6, IPv4 is a bit more complicated), we may end
up with an incorrect m_pkthdr.len after authentication or decryption. In
the case of ESP, this can lead to a remote crash on this instruction:

	m_copydata(m, m->m_pkthdr.len - 3, 3, lastthree);

m_pkthdr.len is bigger than the actual mbuf chain.

It seems possible to me to trigger this bug even if you don't have the ESP
key, because the fragmentation part is outside of the encrypted ESP
payload.

So if you MITM the target, and intercept an incoming ESP packet (which you
can't decrypt), you should be able to forge a new specially-crafted,
fragmented packet and stuff the ESP payload (still encrypted, as you
intercepted it) into it. The decryption succeeds and the target crashes.

Revision 1.178 / (download) - annotate - [select for diffs], Wed Feb 28 10:30:20 2018 UTC (6 years ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-base
Branch point for: pgoyette-compat
Changes since 1.177: +1 -17 lines
Diff to previous 1.177 (colored)

Remove unused mbuf tags.

Revision 1.177 / (download) - annotate - [select for diffs], Tue Feb 27 14:28:01 2018 UTC (6 years ago) by maxv
Branch: MAIN
Changes since 1.176: +1 -3 lines
Diff to previous 1.176 (colored)

Remove the Econet code. It was part of acorn26, which was removed a
month ago.

Revision 1.176 / (download) - annotate - [select for diffs], Tue Feb 27 14:14:19 2018 UTC (6 years ago) by maxv
Branch: MAIN
Changes since 1.175: +18 -18 lines
Diff to previous 1.175 (colored)

style and fix typo

Revision 1.175 / (download) - annotate - [select for diffs], Mon Jan 22 07:11:45 2018 UTC (6 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.174: +6 -1 lines
Diff to previous 1.174 (colored)

Add KASSERTs in *_ALIGN: ensure the mbuf is of the correct type, and
also make sure m->m_data points at the beginning of the mbuf.

Revision 1.174 / (download) - annotate - [select for diffs], Sun Jan 14 17:16:58 2018 UTC (6 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.173: +2 -2 lines
Diff to previous 1.173 (colored)

KDASSERT -> KASSERT. This code is fast and useful.

Revision 1.173 / (download) - annotate - [select for diffs], Mon Jan 1 12:09:56 2018 UTC (6 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.172: +1 -8 lines
Diff to previous 1.172 (colored)

Don't use macros, rather inline, much clearer.

For the record, I was partly mistaken in my previous commit: even though
the macros were local, the function names were still the ones of the real
callers.

However, setting the name in m_data was not a good thing; this was a
valid pointer, and the kernel could execute a long time before figuring
out the mbuf was already freed - therefore making debugging more difficult.
And information on the caller can be obtained via ddb anyway.

Revision 1.172 / (download) - annotate - [select for diffs], Thu Nov 9 22:34:07 2017 UTC (6 years, 4 months ago) by riastradh
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.171: +2 -2 lines
Diff to previous 1.171 (colored)

panic ex nihilo -- PR_NOWAITing for zerot

Revision 1.171 / (download) - annotate - [select for diffs], Tue Sep 26 07:42:06 2017 UTC (6 years, 5 months ago) by knakahara
Branch: MAIN
Changes since 1.170: +12 -5 lines
Diff to previous 1.170 (colored)

VLAN ID uses pkthdr instead of mtag now. Contributed by s-yamaguchi@IIJ.

I just commit by proxy. Reviewed by joerg@n.o and christos@n.o, thanks.
See http://mail-index.netbsd.org/tech-net/2017/09/26/msg006459.html

XXX need pullup to -8 branch

Revision 1.170 / (download) - annotate - [select for diffs], Sat May 27 21:02:56 2017 UTC (6 years, 9 months ago) by bouyer
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base
Branch point for: netbsd-8
Changes since 1.169: +2 -1 lines
Diff to previous 1.169 (colored)

merge the bouyer-socketcan branch to HEAD.

CAN stands for Controller Area Network, a broadcast network used
in automation and automotive fields. For example, the NMEA2000 standard
developped for marine devices uses a CAN network as the link layer.

This is an implementation of the linux socketcan API:
https://www.kernel.org/doc/Documentation/networking/can.txt
you can also see can(4).

This adds a new socket family (AF_CAN) and protocol (PF_CAN),
as well as the canconfig(8) utility, used to set timing parameter of
CAN hardware. Also inclued is a driver for the CAN controller
found in the allwinner A20 SoC (I tested it with an Olimex lime2 board,
connected with PIC18-based CAN devices).

There is also the canloop(4) pseudo-device, which allows to use
the socketcan API without CAN hardware.

At this time the CANFD part of the linux socketcan API is not implemented.
Error frames are not implemented either. But I could get the cansend and
canreceive utilities from the canutils package to build and run with minimal
changes. tcpudmp(8) can also be used to record frames, which can be
decoded with etherreal.

Revision 1.169 / (download) - annotate - [select for diffs], Fri Mar 31 06:49:44 2017 UTC (6 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Changes since 1.168: +2 -1 lines
Diff to previous 1.168 (colored)

Don't use a single global variable to store source route information for multiple incoming packets

It's not MP-safe. So use a m_tag to store the information instead.

Pointed out by knakahara@
The fix is from OpenBSD (originally fixed in FreeBSD)

Revision 1.168 / (download) - annotate - [select for diffs], Tue Feb 7 02:36:48 2017 UTC (7 years, 1 month ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320
Changes since 1.167: +13 -5 lines
Diff to previous 1.167 (colored)

Tweak m_get_rcvif

Call pserialize_read_exit if if_byindex returns NULL in m_get_rcvif.
By changing so, callers need to call m_put_rcvif only if m_get_rcvif
returns non-NULL.

Old m_get_rcvif/m_put_rcvif could forget to call pserialize_read_exit,
which is pointed out by maxv@. The change fixes it.

Revision 1.167 / (download) - annotate - [select for diffs], Tue Oct 4 14:13:21 2016 UTC (7 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, pgoyette-localcount-20161104, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.166: +9 -21 lines
Diff to previous 1.166 (colored)

Hide MFREE now that it is not being used anymore and provide some debugging
for the location of the last free for debugging kernels.

Revision 1.166 / (download) - annotate - [select for diffs], Tue Jun 21 03:07:54 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.165: +2 -2 lines
Diff to previous 1.165 (colored)

Introduce if_index_t

Revision 1.165 / (download) - annotate - [select for diffs], Sun Jun 12 10:14:12 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.164: +4 -2 lines
Diff to previous 1.164 (colored)

Fix m_reset_rcvif

m_reset_rcvif should zero whole m_pkthdr._rcvif union, which is
the original behavior.

Revision 1.164 / (download) - annotate - [select for diffs], Fri Jun 10 13:31:45 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.163: +80 -9 lines
Diff to previous 1.163 (colored)

Avoid storing a pointer of an interface in a mbuf

Having a pointer of an interface in a mbuf isn't safe if we remove big
kernel locks; an interface object (ifnet) can be destroyed anytime in any
packet processing and accessing such object via a pointer is racy. Instead
we have to get an object from the interface collection (ifindex2ifnet) via
an interface index (if_index) that is stored to a mbuf instead of an
pointer.

The change provides two APIs: m_{get,put}_rcvif_psref that use psref(9)
for sleep-able critical sections and m_{get,put}_rcvif that use
pserialize(9) for other critical sections. The change also adds another
API called m_get_rcvif_NOMPSAFE, that is NOT MP-safe and for transition
moratorium, i.e., it is intended to be used for places where are not
planned to be MP-ified soon.

The change adds some overhead due to psref to performance sensitive paths,
however the overhead is not serious, 2% down at worst.

Proposed on tech-kern and tech-net.

Revision 1.163 / (download) - annotate - [select for diffs], Fri Jun 10 13:27:17 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.162: +16 -2 lines
Diff to previous 1.162 (colored)

Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.

Revision 1.162 / (download) - annotate - [select for diffs], Thu May 26 05:04:46 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529
Changes since 1.161: +2 -1 lines
Diff to previous 1.161 (colored)

Introduce M_CLEARCTX and use it instead of open-coding rcvif

No functional change.

Revision 1.161 / (download) - annotate - [select for diffs], Wed Apr 20 08:56:32 2016 UTC (7 years, 11 months ago) by knakahara
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422
Changes since 1.160: +17 -1 lines
Diff to previous 1.160 (colored)

IFQ_ENQUEUE refactor (1/3) : add altq_pktattr fields to m_pkthdr

Reviewed by joerg@n.o and tls@n.o, thanks.

Revision 1.160 / (download) - annotate - [select for diffs], Wed Apr 20 08:50:43 2016 UTC (7 years, 11 months ago) by knakahara
Branch: MAIN
Changes since 1.159: +33 -1 lines
Diff to previous 1.159 (colored)

Add init function for mbuf.

some functions use mbuf as stack variable instead of allocating by m_get().
They should use this function(s) to prevent access to uninitialized fields.

Currently, the mbuf stack allocating functions are the following.
    + sys/dev/ic/bwi.c
      - bwi_rxeof()
      - bwi_encap()
    + sys/dev/ic/dp8390.c
      - dp8390_ipkdb_send()
    + sys/dev/pci/if_txp.c
      - txp_download_fw_section()
    + sys/dev/ppbus/if_plip.c
      - lptap()
    + sys/net/bpf.c
      - _pf_mtap2()
      - _pf_mtap_af()
      - _pf_mtap_sl_out()
    + sys/netisdn/i4b_ipr.c
      - ipr_rx_data_rdy()
      - ipr_tx_queue_empty()

Reviewed by kre@n.o and christos@n.o, thanks.

Revision 1.159 / (download) - annotate - [select for diffs], Tue Oct 13 21:28:34 2015 UTC (8 years, 5 months ago) by rjs
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319, nick-nhusb-base-20151226
Changes since 1.158: +2 -1 lines
Diff to previous 1.158 (colored)

Add core networking support for SCTP.

Revision 1.158 / (download) - annotate - [select for diffs], Thu Jun 4 09:19:59 2015 UTC (8 years, 9 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921, nick-nhusb-base-20150606
Changes since 1.157: +3 -1 lines
Diff to previous 1.157 (colored)

Pull out route lookups from L2 output routines

Route lookups for routes of RTF_GATEWAY were done in L2 output
routines such as ether_output, but they should be done in L3
i.e., before L2 output routines. This change places the lookups
between L3 output routines (say ip_output) and the L2 output
routines.

The change is based on dyoung's patch submitted in the thread:
https://mail-index.netbsd.org/tech-net/2013/02/01/msg003847.html
You can find out detailed investigations by dyoung about the
issue in there.

Note that the change introduces a workaround for MPLS. ether_output
knew that it needs to fill the ethertype of a frame as MPLS,
based on a tag of an original route (rtentry), but now we don't
pass it to ehter_output. So we have to tell that in another way.
We use mtag to do so for now, which introduces some overhead.
We should fix it somehow in the future.

Discussed on tech-kern and tech-net.

Revision 1.157 / (download) - annotate - [select for diffs], Mon Mar 2 16:16:08 2015 UTC (9 years ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406
Changes since 1.156: +27 -22 lines
Diff to previous 1.156 (colored)

Add more zeroes in the constants, no functional change

Revision 1.156 / (download) - annotate - [select for diffs], Fri Sep 5 05:48:59 2014 UTC (9 years, 6 months ago) by matt
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.155: +5 -5 lines
Diff to previous 1.155 (colored)

const mbuftypes
explicitly cast assignments to ext_buf

Revision 1.155 / (download) - annotate - [select for diffs], Sat May 17 23:27:59 2014 UTC (9 years, 10 months ago) by rmind
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, rmind-smpnet-nbase, rmind-smpnet-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-base, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Branch point for: netbsd-7-nhusb, netbsd-7-1, netbsd-7-0, netbsd-7
Changes since 1.154: +1 -2 lines
Diff to previous 1.154 (colored)

- fsocreate: set SS_NBIO before the file descriptor is affixed as there is
  a theoretical race condition (hard to trigger, though); remove the LWP
  parameter and clean up the code a little.
- Sprinkle few comments.
- Remove M_SOOPTS while here.

Revision 1.154 / (download) - annotate - [select for diffs], Thu Mar 20 00:29:57 2014 UTC (10 years ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9, riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Branch point for: tls-earlyentropy
Changes since 1.153: +7 -7 lines
Diff to previous 1.153 (colored)

Adjust comment indent.

no useful change

Revision 1.153 / (download) - annotate - [select for diffs], Thu Nov 14 00:50:36 2013 UTC (10 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base3
Changes since 1.152: +2 -2 lines
Diff to previous 1.152 (colored)

change M_COPYALL to be -1 instead of depending on it too be "too large",
so that we check explicitly against it in all places. ok gimpy

Revision 1.152 / (download) - annotate - [select for diffs], Thu Jun 27 17:47:18 2013 UTC (10 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.151: +5 -2 lines
Diff to previous 1.151 (colored)

- add m_add() that puts an mbuf to end of a chain
- m_append() and m_align() with their family
- remove parameters from prototypes

Revision 1.151 / (download) - annotate - [select for diffs], Sat Jan 19 00:51:52 2013 UTC (11 years, 2 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base8, khorben-n900, agc-symver-base, agc-symver
Changes since 1.150: +3 -1 lines
Diff to previous 1.150 (colored)

Add m_ensure_contig() routine, which is equivalent to m_pullup, but does not
destroy the mbuf chain on failure (it is kept valid).

Revision 1.150 / (download) - annotate - [select for diffs], Thu Dec 27 14:41:10 2012 UTC (11 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.149: +5 -5 lines
Diff to previous 1.149 (colored)

- hit me with your parenthesis stick
- remove extra void *

Revision 1.149 / (download) - annotate - [select for diffs], Sun Apr 29 16:36:54 2012 UTC (11 years, 10 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, jmcneill-usbmp-base9, jmcneill-usbmp-base10
Branch point for: tls-maxphys
Changes since 1.148: +1 -22 lines
Diff to previous 1.148 (colored)

Remove the unused 'struct malloc_type' args to kern_malloc/realloc/free
The M_xxx arg is left on the calls to malloc() and free(),
  maybe they could be converted to an enumeration and just saved in
  the malloc header (for deep diag use).
Remove the malloc_type from mbuf extension.
Fixes rump build as well.
Welcome to 6.99.6

Revision 1.148 / (download) - annotate - [select for diffs], Mon Nov 21 04:36:05 2011 UTC (12 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base4, netbsd-6-base, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base
Branch point for: netbsd-6, jmcneill-usbmp
Changes since 1.147: +2 -2 lines
Diff to previous 1.147 (colored)

change printf gcc attribute to __printflike(), requested by joerg.

Revision 1.147 / (download) - annotate - [select for diffs], Sun Nov 20 23:37:00 2011 UTC (12 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.146: +3 -2 lines
Diff to previous 1.146 (colored)

add more missing printf attributes.

Revision 1.146 / (download) - annotate - [select for diffs], Wed Sep 21 18:10:25 2011 UTC (12 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache
Changes since 1.145: +14 -1 lines
Diff to previous 1.145 (colored)

Put the mbuf type in the ktrace record so that we know how to decode it
in userland.

Revision 1.145 / (download) - annotate - [select for diffs], Mon Aug 8 19:10:33 2011 UTC (12 years, 7 months ago) by dyoung
Branch: MAIN
Changes since 1.144: +6 -2 lines
Diff to previous 1.144 (colored)

Miscellaneous mbuf changes:

1 Add some protection against double-freeing mbufs in DIAGNOSTIC kernels.

2 Add a m_defrag() that's derived from
  sys/dev/pci/if_vge.c:vge_m_defrag().  This one copies the packet
  header.

3 Constify m_tag_find().

Revision 1.144 / (download) - annotate - [select for diffs], Fri Oct 24 22:31:40 2008 UTC (15 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base7, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, uebayasi-xip, rmind-uvmplock-nbase, rmind-uvmplock-base, rmind-uvmplock, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, nick-hppapmap, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, matt-premerge-20091211, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-premerge-20101231, matt-mips64-base2, jymxensuspend-base, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, jruoho-x86intr-base, jruoho-x86intr, haad-nbase2, haad-dm-base2, haad-dm-base, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, ad-audiomp2-base, ad-audiomp2
Changes since 1.143: +9 -4 lines
Diff to previous 1.143 (colored)

Constify m_length().  Reserve a packet tag for use later.

Revision 1.143 / (download) - annotate - [select for diffs], Wed Jun 18 09:06:28 2008 UTC (15 years, 9 months ago) by yamt
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, haad-dm-base1
Branch point for: haad-dm
Changes since 1.142: +3 -7 lines
Diff to previous 1.142 (colored)

merge yamt-pf42 branch.
(import newer pf from OpenBSD 4.2)

ok'ed by peter@.  requested by core@

Revision 1.142 / (download) - annotate - [select for diffs], Sun Jun 15 21:11:49 2008 UTC (15 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-base4
Changes since 1.141: +14 -12 lines
Diff to previous 1.141 (colored)

cleanup the flags and define M_LINK7; fix the format string.

Revision 1.141 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:10 2008 UTC (15 years, 10 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa, simonb-wapbl
Changes since 1.140: +1 -8 lines
Diff to previous 1.140 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.140 / (download) - annotate - [select for diffs], Mon Mar 24 12:24:37 2008 UTC (15 years, 11 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp
Changes since 1.139: +43 -107 lines
Diff to previous 1.139 (colored)

merge yamt-lazymbuf branch.

Revision 1.139 / (download) - annotate - [select for diffs], Thu Jan 17 14:49:28 2008 UTC (16 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Branch point for: mjf-devfs2
Changes since 1.138: +69 -110 lines
Diff to previous 1.138 (colored)

make some mbuf related statistics per-cpu.

Revision 1.138 / (download) - annotate - [select for diffs], Sat Nov 10 13:06:23 2007 UTC (16 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, matt-armv6-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf, bouyer-xeni386-merge1, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: bouyer-xeni386
Changes since 1.137: +1 -3 lines
Diff to previous 1.137 (colored)

g/c MBUFTRACE_ASSERT

Revision 1.137 / (download) - annotate - [select for diffs], Fri Nov 9 16:58:19 2007 UTC (16 years, 4 months ago) by matt
Branch: MAIN
Changes since 1.136: +2 -2 lines
Diff to previous 1.136 (colored)

Change MOWNER_INIT to use C99 structure initializers.

Revision 1.136 / (download) - annotate - [select for diffs], Wed Nov 7 00:23:41 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.135: +10 -12 lines
Diff to previous 1.135 (colored)

Merge from vmlocking:

- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.

Revision 1.135 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:41 2007 UTC (17 years ago) by christos
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-idlelwp-base8, vmlocking-base, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, mjf-ufs-trans, matt-mips64-base, matt-mips64, jmcneill-base, hpcarm-cleanup
Branch point for: vmlocking, mjf-devfs, matt-armv6, jmcneill-pm, bouyer-xenamd64
Changes since 1.134: +10 -10 lines
Diff to previous 1.134 (colored)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.134 / (download) - annotate - [select for diffs], Wed Feb 21 23:00:10 2007 UTC (17 years ago) by thorpej
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored)

Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.

Revision 1.133 / (download) - annotate - [select for diffs], Thu Nov 23 19:41:58 2006 UTC (17 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, post-newlock2-merge, newlock2-nbase, newlock2-base, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm
Branch point for: yamt-idlelwp
Changes since 1.132: +3 -2 lines
Diff to previous 1.132 (colored)

implement ipv6 TSO.
partly from Matthias Scheler.  tested by him.

Revision 1.132 / (download) - annotate - [select for diffs], Fri Nov 17 12:33:39 2006 UTC (17 years, 4 months ago) by ws
Branch: MAIN
Changes since 1.131: +2 -2 lines
Diff to previous 1.131 (colored)

Looks like the capability of octal counting is vanishing (hi, yamt).

Revision 1.131 / (download) - annotate - [select for diffs], Tue Oct 10 21:49:15 2006 UTC (17 years, 5 months ago) by dogcow
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.130: +2 -2 lines
Diff to previous 1.130 (colored)

change the MOWNER_INIT define to take two args; fix extant struct mowner
decls to use it. Makes options MBUFTRACE compile again and not whinge about
missing structure declarations. (Also makes initialization consistent.)

Revision 1.130 / (download) - annotate - [select for diffs], Sun Aug 27 23:50:00 2006 UTC (17 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.129: +3 -1 lines
Diff to previous 1.129 (colored)

Add initializer for MOWNER

Revision 1.129 / (download) - annotate - [select for diffs], Fri Jul 28 17:34:13 2006 UTC (17 years, 7 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.128: +3 -1 lines
Diff to previous 1.128 (colored)

Extract predicate M_UNWRITABLE(m, len), which is true iff len
consecutive bytes at the front of m are writable (i.e., neither
shared nor read-only).

Revision 1.128 / (download) - annotate - [select for diffs], Mon Jun 19 15:44:56 2006 UTC (17 years, 9 months ago) by gdamore
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, chap-midi-nbase, chap-midi-base
Changes since 1.127: +54 -1 lines
Diff to previous 1.127 (colored)

Initial import of bluetooth stack on behalf of Iain Hibbert.  (plunky@,
NetBSD Foundation Membership still pending.)  This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.

Revision 1.127 / (download) - annotate - [select for diffs], Thu Mar 16 13:41:56 2006 UTC (18 years ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, simonb-timecounters-base, peter-altq-base, peter-altq, gdamore-uart-base, elad-kernelauth-base
Branch point for: gdamore-uart, chap-midi
Changes since 1.126: +2 -2 lines
Diff to previous 1.126 (colored)

fix EXT_ bits in M_FLAGS_BITS.

Revision 1.126 / (download) - annotate - [select for diffs], Tue Mar 14 22:40:53 2006 UTC (18 years ago) by yamt
Branch: MAIN
Changes since 1.125: +2 -2 lines
Diff to previous 1.125 (colored)

fix a typo in M_FLAGS_BITS.

Revision 1.125 / (download) - annotate - [select for diffs], Mon Mar 6 20:06:55 2006 UTC (18 years ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base2
Branch point for: elad-kernelauth
Changes since 1.124: +3 -3 lines
Diff to previous 1.124 (colored)

remove + 0 from M_GETCTX; breaks with warning about pointer arithmetic on
void *. Reported by plunky.

Revision 1.124 / (download) - annotate - [select for diffs], Mon Feb 27 05:46:39 2006 UTC (18 years ago) by dyoung
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base
Branch point for: yamt-pdpolicy
Changes since 1.123: +9 -6 lines
Diff to previous 1.123 (colored)

Add link-layer specific flags, M_LINK[456], for future use by
net80211, especially transmit-packet fragmentation and "fast frames."

Revision 1.123 / (download) - annotate - [select for diffs], Thu Feb 16 20:17:20 2006 UTC (18 years, 1 month ago) by perry
Branch: MAIN
Changes since 1.122: +5 -5 lines
Diff to previous 1.122 (colored)

Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.

Revision 1.122 / (download) - annotate - [select for diffs], Sun Feb 12 10:32:46 2006 UTC (18 years, 1 month ago) by bjh21
Branch: MAIN
Changes since 1.121: +3 -1 lines
Diff to previous 1.121 (colored)

Make Econet code compile again.

Revision 1.121 / (download) - annotate - [select for diffs], Tue Jan 31 17:48:27 2006 UTC (18 years, 1 month ago) by christos
Branch: MAIN
Branch point for: simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.120: +2 -2 lines
Diff to previous 1.120 (colored)

PR/32679: Yves-Emmanuel JUTARD: Add unneeded cast to function to pacify the
compiler.

Revision 1.120 / (download) - annotate - [select for diffs], Tue Jan 24 13:02:57 2006 UTC (18 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.119: +11 -1 lines
Diff to previous 1.119 (colored)

add ddb "sh mbuf" command.

Revision 1.119 / (download) - annotate - [select for diffs], Sat Jan 21 00:15:35 2006 UTC (18 years, 2 months ago) by rpaulo
Branch: MAIN
Changes since 1.118: +3 -1 lines
Diff to previous 1.118 (colored)

Better support of IPv6 scoped addresses.

- most of the kernel code will not care about the actual encoding of
  scope zone IDs and won't touch "s6_addr16[1]" directly.
- similarly, most of the kernel code will not care about link-local
  scoped addresses as a special case.
- scope boundary check will be stricter.  For example, the current
  *BSD code allows a packet with src=::1 and dst=(some global IPv6
  address) to be sent outside of the node, if the application do:
    s = socket(AF_INET6);
    bind(s, "::1");
    sendto(s, some_global_IPv6_addr);
  This is clearly wrong, since ::1 is only meaningful within a single
  node, but the current implementation of the *BSD kernel cannot
  reject this attempt.
- and, while there, don't try to remove the ff02::/32 interface route
  entry in in6_ifdetach() as it's already gone.

This also includes some level of support for the standard source
address selection algorithm defined in RFC3484, which will be
completed on in the future.

From the KAME project via JINMEI Tatuya.
Approved by core@.

Revision 1.118 / (download) - annotate - [select for diffs], Mon Dec 26 18:41:36 2005 UTC (18 years, 2 months ago) by perry
Branch: MAIN
Branch point for: yamt-uio_vmspace
Changes since 1.117: +5 -5 lines
Diff to previous 1.117 (colored)

u_intN_t -> uintN_t

Revision 1.117 / (download) - annotate - [select for diffs], Sat Dec 24 19:01:28 2005 UTC (18 years, 2 months ago) by perry
Branch: MAIN
Changes since 1.116: +5 -5 lines
Diff to previous 1.116 (colored)

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.116 / (download) - annotate - [select for diffs], Sun Dec 4 20:21:33 2005 UTC (18 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: ktrace-lwp-base
Changes since 1.115: +2 -1 lines
Diff to previous 1.115 (colored)

grr, forgot to commit the new m_getcl() prototype.

Revision 1.115 / (download) - annotate - [select for diffs], Thu Aug 18 00:30:59 2005 UTC (18 years, 7 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr
Changes since 1.114: +8 -1 lines
Diff to previous 1.114 (colored)

- 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.

Revision 1.114 / (download) - annotate - [select for diffs], Wed Aug 10 12:58:37 2005 UTC (18 years, 7 months ago) by yamt
Branch: MAIN
Changes since 1.113: +14 -1 lines
Diff to previous 1.113 (colored)

ipv6 tx checksum offloading.  reviewed by Jason Thorpe.

Revision 1.113 / (download) - annotate - [select for diffs], Tue Jul 26 22:52:48 2005 UTC (18 years, 7 months ago) by dyoung
Branch: MAIN
Changes since 1.112: +2 -1 lines
Diff to previous 1.112 (colored)

Resolve conflicts.

Revision 1.112 / (download) - annotate - [select for diffs], Mon Jun 6 06:06:50 2005 UTC (18 years, 9 months ago) by martin
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (colored)

Since we decided "const struct mbuf *" would not do the right thing (tm),
remove ~all const from mbuf pointers.

Revision 1.111 / (download) - annotate - [select for diffs], Mon Jun 6 04:50:28 2005 UTC (18 years, 9 months ago) by martin
Branch: MAIN
Changes since 1.110: +2 -2 lines
Diff to previous 1.110 (colored)

Constify the source arg of m_copydata

Revision 1.110 / (download) - annotate - [select for diffs], Thu Jun 2 15:19:28 2005 UTC (18 years, 9 months ago) by tron
Branch: MAIN
Changes since 1.109: +2 -2 lines
Diff to previous 1.109 (colored)

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".

Revision 1.109 / (download) - annotate - [select for diffs], Thu Jun 2 10:34:59 2005 UTC (18 years, 9 months ago) by tron
Branch: MAIN
Changes since 1.108: +2 -2 lines
Diff to previous 1.108 (colored)

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.

Revision 1.108 / (download) - annotate - [select for diffs], Wed Jun 1 18:03:50 2005 UTC (18 years, 9 months ago) by drochner
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored)

prepend an underscore to local variables in macros, to avoid shadowing
user defined ones

Revision 1.107 / (download) - annotate - [select for diffs], Mon May 23 17:34:07 2005 UTC (18 years, 10 months ago) by dbj
Branch: MAIN
Changes since 1.106: +13 -13 lines
Diff to previous 1.106 (colored)

reorganize MGET and MGETHDR slightly so MBUFLOCK only needs to be taken once

Revision 1.106 / (download) - annotate - [select for diffs], Sat Apr 23 14:05:28 2005 UTC (18 years, 11 months ago) by manu
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.105: +2 -1 lines
Diff to previous 1.105 (colored)

Enhance IPSEC_NAT_T so that it can work with multiple machines behind the
same NAT.

Revision 1.105 / (download) - annotate - [select for diffs], Sun Mar 6 00:08:30 2005 UTC (19 years ago) by matt
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base
Branch point for: netbsd-3
Changes since 1.104: +3 -1 lines
Diff to previous 1.104 (colored)

Add beginning of TCP Segment Offload support.

Revision 1.104 / (download) - annotate - [select for diffs], Sat Feb 26 22:25:34 2005 UTC (19 years ago) by perry
Branch: MAIN
Changes since 1.103: +3 -3 lines
Diff to previous 1.103 (colored)

nuke trailing whitespace

Revision 1.103 / (download) - annotate - [select for diffs], Mon Feb 21 02:12:48 2005 UTC (19 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.102: +8 -1 lines
Diff to previous 1.102 (colored)

Define M_CSUM_DATA_IPv4_IPHL() and M_CSUM_DATA_IPv4_OFFSET() macros
to extract data from csum_data, rather than just open-coding it.

Revision 1.102 / (download) - annotate - [select for diffs], Fri Feb 18 00:52:56 2005 UTC (19 years, 1 month ago) by heas
Branch: MAIN
Changes since 1.101: +12 -21 lines
Diff to previous 1.101 (colored)

My last change for pseudo-header checksums was flawed.  The pseudo-header
checksum is always in the L4 header by the time we get to this point.  It
was occasionally not there due to a bug in tcp_respond, which has since
been fixed.
So, instead just stash the length of the L3 header in the high 16 bits of
csum_data.

Revision 1.101 / (download) - annotate - [select for diffs], Sat Feb 12 23:25:29 2005 UTC (19 years, 1 month ago) by heas
Branch: MAIN
Changes since 1.100: +17 -6 lines
Diff to previous 1.100 (colored)

For controllers (eg: hme & gem) that can only perform linear hardware checksums
(from an offset to the end of the packet), the pseudo-header checksum must be
calculated by software.  So, provide it in the TCP/UDP header when
M_CSUM_NO_PSEUDOHDR is set in the interface's if_csum_flags_tx.

The start offset, the end of the IP header, is also provided in the high 16
bits of pkthdr.csum_data.  Such that the driver need not examine the packet
at all.

XXX At the request of Jonathan Stone, note that sharing of if_csum_flags_tx &
    pkthdr.csum_flags for checksum quirks should be re-evaluated.

Revision 1.100 / (download) - annotate - [select for diffs], Mon Jan 31 23:49:36 2005 UTC (19 years, 1 month ago) by kim
Branch: MAIN
CVS Tags: yamt-km-base2
Changes since 1.99: +2 -1 lines
Diff to previous 1.99 (colored)

Add RFC 3378 EtherIP support, ported from OpenBSD to NetBSD by
Hans Rosenfeld (rosenfeld at grumpf.hope-2000.org)

This change makes it possible to add gif interfaces to bridges, which
will then send and receive IP protocol 97 packets. Packets are Ethernet
frames with an EtherIP header prepended.

Revision 1.99 / (download) - annotate - [select for diffs], Tue Sep 21 21:57:30 2004 UTC (19 years, 6 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Changes since 1.98: +9 -6 lines
Diff to previous 1.98 (colored)

introduce M_EXT_RW to allow mbuf external storage R/W.
discussed on tech-net@.

Revision 1.98 / (download) - annotate - [select for diffs], Wed Sep 8 12:00:28 2004 UTC (19 years, 6 months ago) by yamt
Branch: MAIN
Changes since 1.97: +4 -4 lines
Diff to previous 1.97 (colored)

m_copyback, m_copyback_cow, m_copydata:
- caddr_t -> void *
- constify.
partly from openbsd.

Revision 1.97 / (download) - annotate - [select for diffs], Wed Sep 8 11:59:01 2004 UTC (19 years, 6 months ago) by yamt
Branch: MAIN
Changes since 1.96: +36 -44 lines
Diff to previous 1.96 (colored)

- move a common part of MEXTREMOVE and MFREE into a inline function.
- wrap more definitions in #ifdef _KERNEL.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Sep 6 09:43:29 2004 UTC (19 years, 6 months ago) by yamt
Branch: MAIN
Changes since 1.95: +3 -1 lines
Diff to previous 1.95 (colored)

add m_copyback_cow and m_makewritable.

Revision 1.95 / (download) - annotate - [select for diffs], Fri Jun 25 15:23:57 2004 UTC (19 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.94: +2 -1 lines
Diff to previous 1.94 (colored)

null out m_pkthdr.rcvif on MGETHDR.  otherwise we will touch unexpected
memory region on m->m_pkthdr.rcvif access (NULL is at least debuggable than
random junk value).

Revision 1.94 / (download) - annotate - [select for diffs], Thu Jun 24 04:15:50 2004 UTC (19 years, 8 months ago) by jonathan
Branch: MAIN
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored)

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

Revision 1.93 / (download) - annotate - [select for diffs], Tue Jun 22 14:04:04 2004 UTC (19 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.92: +3 -1 lines
Diff to previous 1.92 (colored)

foundation for PF

Revision 1.92 / (download) - annotate - [select for diffs], Sun Jun 6 04:35:53 2004 UTC (19 years, 9 months ago) by dyoung
Branch: MAIN
Changes since 1.91: +21 -1 lines
Diff to previous 1.91 (colored)

Per Matt Thomas' and Darren Reed's suggestions:

Add bpf_deliver prototype.

Rename bpf_measure to m_length and move it to sys/sys/mbuf.h.  I
make m_length an inline function in the header file to preserve
its performance characteristics, for better or for worse.

Optimize m_length: use the length in m_pkthdr.len, if M_PKTHDR.

In bpf_deliver, zero the on-stack mbuf before we do anything else
with it.

Revision 1.91 / (download) - annotate - [select for diffs], Fri Apr 9 15:43:19 2004 UTC (19 years, 11 months ago) by atatat
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

Standalone programs should not use stddef.h.  They are more like the
kernel, so they must use sys/systm.h instead.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Mar 22 17:56:30 2004 UTC (20 years ago) by matt
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.89: +2 -36 lines
Diff to previous 1.89 (colored)

Remove my copyright and add me to the TNF copyright.

Revision 1.89 / (download) - annotate - [select for diffs], Tue Feb 10 01:33:26 2004 UTC (20 years, 1 month ago) by matt
Branch: MAIN
Changes since 1.88: +13 -8 lines
Diff to previous 1.88 (colored)

Split MCLGET macro to be able to support multiple M_CLUSTER sizes.
Store the pool_cache the cluster was allocated from into (m)->m_ext.ext_arg
and use that when freeing the cluster.

Revision 1.88 / (download) - annotate - [select for diffs], Thu Nov 13 01:48:12 2003 UTC (20 years, 4 months ago) by jonathan
Branch: MAIN
Changes since 1.87: +2 -1 lines
Diff to previous 1.87 (colored)

Add m_tag_delete_nonpesrsistent(), for deleting all packet tags on
mbuf chains which are recycled (e.g., ICMP reflection, loopback
interface).  A consensus was reached that such recycled packets should
behave (more-or-less) the same way if a new chain had been allocated
and the contents copied to that chain.

Some packet tags may in future be marked as "persistent" (e.g., for
mandatory access controls) and should persist across such deletion.
NetBSD as yet hos no persistent tags, so m_tag_delete_nonpersistent()
just deletes all tags. This should not be relied upon.

Revision 1.87 / (download) - annotate - [select for diffs], Thu Aug 7 16:34:08 2003 UTC (20 years, 7 months ago) by agc
Branch: MAIN
Changes since 1.86: +31 -2 lines
Diff to previous 1.86 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.86 / (download) - annotate - [select for diffs], Mon Aug 4 22:13:04 2003 UTC (20 years, 7 months ago) by jonathan
Branch: MAIN
Changes since 1.85: +13 -1 lines
Diff to previous 1.85 (colored)

(FAST_IPSEC) Add packet tags for FAST_IPSEC.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Jul 27 04:16:23 2003 UTC (20 years, 7 months ago) by jonathan
Branch: MAIN
Changes since 1.84: +7 -1 lines
Diff to previous 1.84 (colored)

Add a csum_flags quirk for devices (like the bcm570x) which hand back
Rx-offloaded TCP or UDP checksums which do not include the transport-layer
pseudo-header. As discussed with Jason Thorpe circa 2003-03.

Revision 1.84 / (download) - annotate - [select for diffs], Thu Jun 26 09:55:10 2003 UTC (20 years, 8 months ago) by itojun
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.83: +2 -1 lines
Diff to previous 1.83 (colored)

sync packet tag w/openbsd

Revision 1.83 / (download) - annotate - [select for diffs], Wed May 14 06:47:46 2003 UTC (20 years, 10 months ago) by itojun
Branch: MAIN
Changes since 1.82: +1 -4 lines
Diff to previous 1.82 (colored)

always use PULLDOWN_TEST codepath.

Revision 1.82 / (download) - annotate - [select for diffs], Thu Apr 17 16:15:36 2003 UTC (20 years, 11 months ago) by scw
Branch: MAIN
Changes since 1.81: +45 -20 lines
Diff to previous 1.81 (colored)

Fix a problem first reported by Simon Burge when paddr_t is 64-bits on an
ILP32 platform.

What happens is that the compiler inserts padding in struct mbuf between the
MH_pkthdr and MH_dat members, due to the paddr_t in struct _m_ext.

Unfortunately, the old MLEN/MHLEN macroes fail to take into account this
padding and, thus, wind up making sizeof(struct mbuf) > MSIZE. This causes
mbuf corruption, which eventually leads to all sorts of bogosity on ILP32
platforms with a 64-bit paddr_t.

Thanks to simonb@ and fvdl@ for helping to track down this bug.

Revision 1.81 / (download) - annotate - [select for diffs], Sat Apr 12 02:49:25 2003 UTC (20 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.80: +6 -3 lines
Diff to previous 1.80 (colored)

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.

Revision 1.80 / (download) - annotate - [select for diffs], Wed Apr 9 18:38:01 2003 UTC (20 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.79: +61 -8 lines
Diff to previous 1.79 (colored)

* 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.

Revision 1.79 / (download) - annotate - [select for diffs], Sat Mar 22 02:21:57 2003 UTC (21 years ago) by thorpej
Branch: MAIN
Changes since 1.78: +18 -10 lines
Diff to previous 1.78 (colored)

* Bump m_flags from "short" to "int", and shuffle the m_hdr accordingly.
  As discussed on tech-net.
* Define a range of bits in the new wider m_flags which are reserved for
  M_EXT mbufs.  Define M_EXT_CLUSTER to indicate the ext is a cluster, and
  re-define M_CLUSTER as M_EXT_CLUSTER for source-level compatibility.
* Define a new M_EXTCOPYFLAGS to be used when manipulating M_EXT state.

Revision 1.78 / (download) - annotate - [select for diffs], Wed Mar 19 00:23:26 2003 UTC (21 years ago) by thorpej
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

Consistently call (*ext_free)() at splvm().

Revision 1.77 / (download) - annotate - [select for diffs], Sun Mar 2 22:35:32 2003 UTC (21 years ago) by thorpej
Branch: MAIN
Changes since 1.76: +5 -5 lines
Diff to previous 1.76 (colored)

Shuffle the order in the file that some mbuf flags are listed.  Flag
values have not changed.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Feb 26 14:36:44 2003 UTC (21 years ago) by drochner
Branch: MAIN
Changes since 1.75: +3 -1 lines
Diff to previous 1.75 (colored)

deactivate MBUFTRACE related KASSERT()s in the !MBUFTRACE case

Revision 1.75 / (download) - annotate - [select for diffs], Wed Feb 26 07:49:02 2003 UTC (21 years ago) by matt
Branch: MAIN
Changes since 1.74: +2 -1 lines
Diff to previous 1.74 (colored)

Define null m_claim macro so #ifdef MBUFTRACE m_claim #endif can just be
m_claim.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Feb 26 06:31:21 2003 UTC (21 years ago) by matt
Branch: MAIN
Changes since 1.73: +110 -6 lines
Diff to previous 1.73 (colored)

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.

Revision 1.73 / (download) - annotate - [select for diffs], Sat Feb 1 06:23:50 2003 UTC (21 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.72: +7 -5 lines
Diff to previous 1.72 (colored)

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.

Revision 1.72 / (download) - annotate - [select for diffs], Fri Jan 31 05:00:24 2003 UTC (21 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.71: +3 -3 lines
Diff to previous 1.71 (colored)

Change ext_size to a size_t, and update the signature of ext_free.

Revision 1.71 / (download) - annotate - [select for diffs], Fri Jan 31 04:55:52 2003 UTC (21 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.70: +24 -24 lines
Diff to previous 1.70 (colored)

ANSI'ify.

Revision 1.70 / (download) - annotate - [select for diffs], Fri Jan 17 10:07:23 2003 UTC (21 years, 2 months ago) by itojun
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base
Changes since 1.69: +2 -1 lines
Diff to previous 1.69 (colored)

pull queue.h in to make userland compilation happy

Revision 1.69 / (download) - annotate - [select for diffs], Fri Jan 17 08:12:00 2003 UTC (21 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.68: +37 -25 lines
Diff to previous 1.68 (colored)

switch from kame-based m_aux mbuf auxiliary data, to openbsd m_tag
implementation.  it will simplify porting across *bsd (such as kame/altq),
and make us more synchronized.  from Joel Wilsson

Revision 1.68 / (download) - annotate - [select for diffs], Sun Dec 1 22:57:17 2002 UTC (21 years, 3 months ago) by matt
Branch: MAIN
CVS Tags: gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.67: +7 -3 lines
Diff to previous 1.67 (colored)

Reorder things so that multiple inclusion protection so optional
definitions are outside the protection checks.

Revision 1.67 / (download) - annotate - [select for diffs], Sun Jun 30 22:40:40 2002 UTC (21 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gehenna-devsw-base
Changes since 1.66: +2 -1 lines
Diff to previous 1.66 (colored)

Changes to allow the IPv4 and IPv6 layers to align headers themseves,
as necessary:
* Implement a new mbuf utility routine, m_copyup(), is is like
  m_pullup(), except that it always prepends and copies, rather
  than only doing so if the desired length is larger than m->m_len.
  m_copyup() also allows an offset into the destination mbuf, which
  allows space for packet headers, in the forwarding case.
* Add *_HDR_ALIGNED_P() macros for IP, IPv6, ICMP, and IGMP.  These
  macros expand to 1 if __NO_STRICT_ALIGNMENT is defined, so that
  architectures which do not have strict alignment constraints don't
  pay for the test or visit the new align-if-needed path.
* Use the new macros to check if a header needs to be aligned, or to
  assert that it already is, as appropriate.

Note: This code is still somewhat experimental.  However, the new
code path won't be visited if individual device drivers continue
to guarantee that packets are delivered to layer 3 already properly
aligned (which are rules that are already in use).

Revision 1.66 / (download) - annotate - [select for diffs], Sat Jun 22 05:37:01 2002 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.65: +2 -2 lines
Diff to previous 1.65 (colored)

minor KNF

Revision 1.65 / (download) - annotate - [select for diffs], Thu May 2 16:22:45 2002 UTC (21 years, 10 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-6-base
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.64: +41 -12 lines
Diff to previous 1.64 (colored)

Change the semantics of mbuf external storage "ext_free" routines
so that they're more useful for arbitrary types of external storage:

* Add an "mbuf *" argument to (*ext_free)().  If non-NULL, (*ext_free)()
  is expected to free the mbuf itself.  This allows (*ext_free)() to use
  the mbuf for bookkeeping (e.g. deferring the work to a helper thread).
  If the "mbuf *" argument is NULL, we are assumed to be in a context
  which is safe for performing the destructor operation *now*.
* Adjust MEXTREMOVE() and MFREE() routines for above change.
* Update "ade" and "ti" drivers for new semantics.

Revision 1.64 / (download) - annotate - [select for diffs], Sat Mar 9 01:46:32 2002 UTC (22 years ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base, newlock, eeh-devprop-base, eeh-devprop
Changes since 1.63: +4 -14 lines
Diff to previous 1.63 (colored)

Make mbpool and mclpool use the new drain hook facaility.  Adjust
m_reclaim() to match the drain hook signature.  This allows us to
delete m_retry() and m_retryhdr(), as the pool allocator will now
perform the reclaimation step for us.

From art@openbsd.org.

Revision 1.63 / (download) - annotate - [select for diffs], Thu Oct 18 20:17:35 2001 UTC (22 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache, ifpoll-base
Changes since 1.62: +1 -2 lines
Diff to previous 1.62 (colored)

Deprecate the "m_act" alias of "m_nextpkt" (m_act is a historical
name), and just use m_nextpkt everywhere.

Revision 1.62 / (download) - annotate - [select for diffs], Fri Oct 5 02:08:09 2001 UTC (22 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-devvp-base3
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

Fix a typo in a comment.

Revision 1.61 / (download) - annotate - [select for diffs], Thu Jul 26 22:08:34 2001 UTC (22 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-devvp-base2, thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp
Changes since 1.60: +185 -167 lines
Diff to previous 1.60 (colored)

Strictly cosmetic changes.

Revision 1.60 / (download) - annotate - [select for diffs], Thu Jul 26 19:05:04 2001 UTC (22 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.59: +11 -7 lines
Diff to previous 1.59 (colored)

Use pool_cache_*() for mbufs and clusters.  While we don't use the
ctor/dtor feature, it's still faster to allocate from the cache groups
than it is from the pool (cache groups are analogous to "magazines"
in the Solaris SLAB allocator).

Revision 1.59 / (download) - annotate - [select for diffs], Thu Jul 26 17:24:59 2001 UTC (22 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.58: +23 -8 lines
Diff to previous 1.58 (colored)

Add an M_READONLY() macro, which evaluates to true if the mbuf's
data area is not to be written to.  This is the case for mbufs with
external storage which is either a non-cluster or a cluster referenced
by multiple mbufs.

Change M_LEADINGSPACE() and M_TRAILINGSPACE() to use M_READONLY(),
rather than their own testing for M_EXT.  Previously, M_LEADINGSPACE()
treated all M_EXT mbufs as read-only (which causes an extra mbuf to
be needlessly allocated when sending large TCP packets), and
M_TRAILINGSPACE() previously did not treat any external storage as
read-only (could lead to data corruption of external storage buffers!).

Revision 1.58 / (download) - annotate - [select for diffs], Sat Jun 2 16:17:11 2001 UTC (22 years, 9 months ago) by thorpej
Branch: MAIN
Branch point for: kqueue
Changes since 1.57: +33 -3 lines
Diff to previous 1.57 (colored)

Implement support for IP/TCP/UDP checksum offloading provided by
network interfaces.  This works by pre-computing the pseudo-header
checksum and caching it, delaying the actual checksum to ip_output()
if the hardware cannot perform the sum for us.  In-bound checksums
can either be fully-checked by hardware, or summed up for final
verification by software.  This method was modeled after how this
is done in FreeBSD, although the code is significantly different in
most places.

We don't delay checksums for IPv6/TCP, but we do take advantage of the
cached pseudo-header checksum.

Note: hardware-assisted checksumming defaults to "off".  It is
enabled with ifconfig(8).  See the manual page for details.

Implement hardware-assisted checksumming on the DP83820 Gigabit Ethernet,
3c90xB/3c90xC 10/100 Ethernet, and Alteon Tigon/Tigon2 Gigabit Ethernet.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Apr 30 01:13:21 2001 UTC (22 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.56: +23 -19 lines
Diff to previous 1.56 (colored)

remove some lint

Revision 1.56 / (download) - annotate - [select for diffs], Sun Jan 14 02:07:22 2001 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored)

splimp() -> splvm() (mbufs are "memory allocation")

Revision 1.55 / (download) - annotate - [select for diffs], Sat Dec 2 03:03:14 2000 UTC (23 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.54: +1 -6 lines
Diff to previous 1.54 (colored)

remove obsolete comment on MINCLSIZE

Revision 1.54 / (download) - annotate - [select for diffs], Tue Nov 14 20:05:28 2000 UTC (23 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.53: +9 -1 lines
Diff to previous 1.53 (colored)

make sure every m_aux will be freed.
there are direct use of MFREE() from sys/kern.
(we experienced no memory leak so far, but if we use m_aux for other purposes,
we will need this change)

Revision 1.53 / (download) - annotate - [select for diffs], Fri Aug 18 16:19:23 2000 UTC (23 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.52: +1 -3 lines
Diff to previous 1.52 (colored)

repair m_dup().  specifically, now it is safe against non-MCLBYTES cluster
mbuf.  noone seem to be using this function at this moment.

Revision 1.52 / (download) - annotate - [select for diffs], Fri Aug 18 14:23:49 2000 UTC (23 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.51: +3 -1 lines
Diff to previous 1.51 (colored)

disable m_dup(), as it makes false assumption on cluster mbuf and unsafe
(does not do the right thing).

Revision 1.51 / (download) - annotate - [select for diffs], Sun Aug 13 01:31:15 2000 UTC (23 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.50: +4 -1 lines
Diff to previous 1.50 (colored)

move "options PULLDOWN_TEST" into sys/sys/mbuf.h (in #ifdef _KERNEL),
as it is no wthe default setting for everyone.

the reason we still use the name "PULLDOWN_TEST" while it is now default:
kame code sharing.

Revision 1.50 / (download) - annotate - [select for diffs], Thu Jul 27 17:18:19 2000 UTC (23 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

recover traditional MINCLSIZE (= MHLEN + MLEN + 1).  it will make
drivers less aggressive about use of cluster mbufs.

this chnage affects drivers with m_devget()-emulation.  many of
recent drivers do not look at MINCLSIZE any more, not sure why.

Revision 1.49 / (download) - annotate - [select for diffs], Wed Mar 1 12:49:27 2000 UTC (24 years ago) by itojun
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-ALPHA2, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5
Changes since 1.48: +17 -1 lines
Diff to previous 1.48 (colored)

introduce m->m_pkthdr.aux to hold random data which needs to be passed
between protocol handlers.

ipsec socket pointers, ipsec decryption/auth information, tunnel
decapsulation information are in my mind - there can be several other usage.
at this moment, we use this for ipsec socket pointer passing.  this will
avoid reuse of m->m_pkthdr.rcvif in ipsec code.

due to the change, MHLEN will be decreased by sizeof(void *) - for example,
for i386, MHLEN was 100 bytes, but is now 96 bytes.
we may want to increase MSIZE from 128 to 256 for some of our architectures.

take caution if you use it for keeping some data item for long period
of time - use extra caution on M_PREPEND() or m_adj(), as they may result
in loss of m->m_pkthdr.aux pointer (and mbuf leak).

this will bump kernel version.

(as discussed in tech-net, tested in kame tree)

Revision 1.48 / (download) - annotate - [select for diffs], Mon Dec 13 15:17:24 1999 UTC (24 years, 3 months ago) by itojun
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, chs-ubc2-newbase
Changes since 1.47: +2 -1 lines
Diff to previous 1.47 (colored)

sync IPv6 part with latest KAME tree.   IPsec part is left unmodified
due to massive changes in KAME side.
- IPv6 output goes through nd6_output
- faith can capture IPv4 packets as well - you can run IPv4-to-IPv6 translator
  using heavily modified DNS servers
- per-interface statistics (required for IPv6 MIB)
- interface autoconfig is revisited
- udp input handling has a big change for mapped address support.
- introduce in4_cksum() for non-overwriting checksumming
- introduce m_pulldown()
- neighbor discovery cleanups/improvements
- netinet/in.h strictly conforms to RFC2553 (no extra defs visible to userland)
- IFA_STATS is fixed a bit (not tested)
- and more more more.

TODO:
- cleanup os-independency #ifdef
- avoid rcvif dual use (for IPsec) to help ifdetach

(sorry for jumbo commit, I can't separate this any more...)

Revision 1.47 / (download) - annotate - [select for diffs], Wed Oct 27 14:23:26 1999 UTC (24 years, 4 months ago) by itojun
Branch: MAIN
CVS Tags: fvdl-softdep-base, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.46: +2 -1 lines
Diff to previous 1.46 (colored)

add mbuf deep-copy fnudtion, m_dup().
NOTE: if you use m_dup(), your additional kernel code can become
incompatible with 4.xBSD or other *BSD.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Aug 5 04:00:03 1999 UTC (24 years, 7 months ago) by sommerfeld
Branch: MAIN
Branch point for: wrstuden-devbsize, thorpej_scsipi, fvdl-softdep
Changes since 1.45: +5 -4 lines
Diff to previous 1.45 (colored)

Create new pool flag PR_LIMITFAIL, indicating that even PR_WAIT
allocations should fail if the pool is at its hard limit.
Document flag in pool(9).
Use it in mbuf.h for the first allocate call for M_GET, M_GETHDR, and
MCLGET, so that m_reclaim gets called even for blocking allocations.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jul 1 08:13:00 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.44: +13 -3 lines
Diff to previous 1.44 (colored)

IPv6 kernel code, based on KAME/NetBSD 1.4, SNAP kit 19990628.
(Sorry for a big commit, I can't separate this into several pieces...)
Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details.

- sys/kern: do not assume single mbuf, accept chained mbuf on passing
  data from userland to kernel (or other way round).
- "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ
  package (ftp://ftp.csl.sony.co.jp/pub/kjc/).
- sys/netinet/tcp*: IPv4/v6 dual stack tcp support.
- sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those
  file to be there so we patch it up.
- sys/netinet: IPsec additions are here and there.
- sys/netinet6/*: most of IPv6 code sits here.
- sys/netkey: IPsec key management code
- dev/pci/pcidevs: regen

In my understanding no code here is subject to export control so it
should be safe.

Revision 1.44 / (download) - annotate - [select for diffs], Tue Apr 27 00:05:44 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.43: +11 -11 lines
Diff to previous 1.43 (colored)

Const'ify mbtypes[].

Revision 1.43 / (download) - annotate - [select for diffs], Mon Apr 26 21:55:53 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.42: +25 -4 lines
Diff to previous 1.42 (colored)

Add mbuf sysctl variables: msize, mclbytes, nmbclusters, mblowat, and
mcllowat.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Feb 27 18:20:37 1999 UTC (25 years ago) by sommerfe
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4
Branch point for: kame, chs-ubc2
Changes since 1.41: +7 -5 lines
Diff to previous 1.41 (colored)

Finish fix for PR7059: rename fields in mbstat we no longer maintain
to _m_spareN; add a comment explaining where to get comparable info.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Jan 24 01:08:22 1999 UTC (25 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

Forgot to update copyright notice in previous.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jan 24 01:07:50 1999 UTC (25 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.39: +14 -1 lines
Diff to previous 1.39 (colored)

Add an MRESETDATA() macro, which will reset the mbuf's data pointer to
the beginning of the data area.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jan 9 22:10:12 1999 UTC (25 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.38: +1 -2 lines
Diff to previous 1.38 (colored)

Garbage-collect `mbutl'.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Jan 9 21:54:07 1999 UTC (25 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.37: +1 -14 lines
Diff to previous 1.37 (colored)

Garbage-collect `union mcluster' and `mclfree'.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Jan 9 21:52:08 1999 UTC (25 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.36: +1 -5 lines
Diff to previous 1.36 (colored)

Garbage-collect mtocl() and cltom().  They're no longer used, and don't
work with pool'ified clusters anyhow.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Oct 23 22:36:17 1998 UTC (25 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: kenh-if-detach-base, chs-ubc-base, chs-ubc
Branch point for: kenh-if-detach
Changes since 1.35: +7 -1 lines
Diff to previous 1.35 (colored)

Call m_reclaim() in MCLGET() if initial pool allocation fails.  Accidentally
removed when mbuf clusters were pool'ified.

Revision 1.35 / (download) - annotate - [select for diffs], Sun Sep 13 14:46:24 1998 UTC (25 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.34: +2 -3 lines
Diff to previous 1.34 (colored)

Fix copyright typos...

Revision 1.34 / (download) - annotate - [select for diffs], Sat Aug 1 01:47:24 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

Don't call the protocol drain routines if how == M_NOWAIT, which typically
means we're in interrupt context.  Since we can be called from a network
hardware interrupt, we could corrupt the protocol queues we try to drain
them at that time.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Aug 1 01:35:20 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.32: +10 -17 lines
Diff to previous 1.32 (colored)

Use the pool allocator for mbufs and mbufs clusters (two pools, one for
each).  Partially from pk@netbsd.org.

Revision 1.32 / (download) - annotate - [select for diffs], Fri May 1 03:21:05 1998 UTC (25 years, 10 months ago) by thorpej
Branch: MAIN
CVS Tags: eeh-paddr_t-base
Branch point for: eeh-paddr_t
Changes since 1.31: +4 -2 lines
Diff to previous 1.31 (colored)

Add an mbuf packet header flag which indicates that a packet can be used
to create a fast-forward flow.

Revision 1.31 / (download) - annotate - [select for diffs], Fri Feb 6 20:53:47 1998 UTC (26 years, 1 month ago) by matt
Branch: MAIN
Changes since 1.30: +8 -1 lines
Diff to previous 1.30 (colored)

Add M_SETCTX and M_GETCTX.  These overload m_pkthdr.rcvif so drivers can
use it as a context field.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Oct 5 18:43:24 1997 UTC (26 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, marc-pcmcia-base
Changes since 1.29: +38 -2 lines
Diff to previous 1.29 (colored)

Copyright assigned to The NetBSD Foundation.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Jun 24 19:14:52 1997 UTC (26 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-signal-base, thorpej-signal, marc-pcmcia-bp, bouyer-scsipi
Branch point for: marc-pcmcia
Changes since 1.28: +1 -3 lines
Diff to previous 1.28 (colored)

Remove the dtom() macro - nothing uses it anymore, and nothing should,
ever, ever again.

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jun 8 17:59:56 1997 UTC (26 years, 9 months ago) by kleink
Branch: MAIN
Changes since 1.27: +5 -5 lines
Diff to previous 1.27 (colored)

Add missing ';'s; necessary for `do {} while (0)' wrapping from last commit.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jun 8 05:36:57 1997 UTC (26 years, 9 months ago) by mikel
Branch: MAIN
Changes since 1.26: +27 -27 lines
Diff to previous 1.26 (colored)

eliminate another dangling reference to <machine/machparam.h>
ensure all macros which use {}s are wrapped with do {} while (0)

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jun 6 17:17:56 1997 UTC (26 years, 9 months ago) by cjs
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Change comment: MSIZE is in machine/param.h, not machine/machparam.h.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jun 6 16:37:41 1997 UTC (26 years, 9 months ago) by kleink
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Raise MINCLSIZE from (MHLEN + MLEN) to (MHLEN + MLEN + 1): MINCLSIZE is the
"smallest amount to put in cluster", and (MHLEN + MLEN) is the largest amount
amount of data that can be stored without clustering.

Pointed out by Thorsten Frueauf <frueauf@ira.uka.de> with W. R. Stevens'
TCP/IP Illustrated, Vol. 2, at hand.

Revision 1.24 / (download) - annotate - [select for diffs], Fri May 23 19:46:08 1997 UTC (26 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.23: +6 -4 lines
Diff to previous 1.23 (colored)

Make sure reference count manipulation is "atomic", from
Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Mar 27 20:33:07 1997 UTC (26 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.22: +174 -82 lines
Diff to previous 1.22 (colored)

Update and enhancement to the mbuf code, to support use of non-cluster
external storage.  Highlights:

	- additional "void *" argument to (*ext_free)(), an opaque
	  cookie for use by the free function.
	- MCLALLOC() and MCLFREE() calls are gone.  They are replaced
	  by MEXTADD() (add external storage to mbuf), MEXTMALLOC()
	  (malloc() external storage and attach to mbuf), and
	  MEXTREMOVE() (remove external storage from mbuf).
	- completely new external storage reference counting
	  mechanism; mclrefcnt[] is gone.

These changes will eventually be used to pass driver DMA buffers up
the network stack, and reduce/eliminate copies in certain code paths
(e.g. NFS writes).

From Matt Thomas <matt@3am-software.com> and myself <thorpej@nas.nasa.gov>,
with some input from Chris Demetriou <cgd@cs.cmu.edu> and review by
Charles Hannum <mycroft@mit.edu>.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jan 22 07:09:17 1997 UTC (27 years, 2 months ago) by mikel
Branch: MAIN
CVS Tags: mrg-vm-swap, is-newarp-before-merge, is-newarp-base, is-newarp
Changes since 1.21: +8 -3 lines
Diff to previous 1.21 (colored)

add multiple inclusion protection

Revision 1.21 / (download) - annotate - [select for diffs], Mon Jun 10 23:55:39 1996 UTC (27 years, 9 months ago) by cgd
Branch: MAIN
CVS Tags: thorpej-setroot
Changes since 1.20: +8 -4 lines
Diff to previous 1.20 (colored)

note that m_get/MGET and friends, and M_PREPEND will never fail if M_WAIT
is specified.  also note that MCLGET _can_.

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jun 10 12:51:21 1996 UTC (27 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.19: +1 -4 lines
Diff to previous 1.19 (colored)

kill #ifdef DATAKIT and Datakit entries in mbuf type table.

Revision 1.19 / (download) - annotate - [select for diffs], Fri Feb 9 18:25:14 1996 UTC (28 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2
Changes since 1.18: +4 -2 lines
Diff to previous 1.18 (colored)

Filesystem prototype changes

Revision 1.18 / (download) - annotate - [select for diffs], Sun Feb 4 02:12:33 1996 UTC (28 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.17: +6 -1 lines
Diff to previous 1.17 (colored)

Fix some missing/wrong prototypes so that kern/* compiles again

Revision 1.17 / (download) - annotate - [select for diffs], Wed Aug 16 01:04:06 1995 UTC (28 years, 7 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.16: +11 -26 lines
Diff to previous 1.16 (colored)

Garbage collect.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jun 13 06:43:51 1995 UTC (28 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (colored)

clear m_ext.ext_free when marking an mbuf has having external storage.
From Jonathan Stone <jonathan@DSG.Stanford.EDU>.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jun 7 00:21:28 1995 UTC (28 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.14: +2 -1 lines
Diff to previous 1.14 (colored)

add m_split proto, as suggested by Ignatios Souvatzis in pr 1076

Revision 1.14 / (download) - annotate - [select for diffs], Wed Mar 29 22:10:01 1995 UTC (28 years, 11 months ago) by briggs
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

KERNEL -> _KERNEL

Revision 1.13 / (download) - annotate - [select for diffs], Sun Oct 30 19:08:35 1994 UTC (29 years, 4 months ago) by cgd
Branch: MAIN
Changes since 1.12: +8 -8 lines
Diff to previous 1.12 (colored)

minor clean, and kill some unnecessary paranoia

Revision 1.12 / (download) - annotate - [select for diffs], Sat Oct 29 08:20:16 1994 UTC (29 years, 4 months ago) by cgd
Branch: MAIN
Changes since 1.11: +9 -9 lines
Diff to previous 1.11 (colored)

clean up types usage.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Sep 19 05:03:09 1994 UTC (29 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (colored)

Prototype m_adj().

Revision 1.10 / (download) - annotate - [select for diffs], Sun Sep 18 01:59:30 1994 UTC (29 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Trivial change to avoid compiler warnings, from Bill Sommerfeld.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jun 29 06:44:37 1994 UTC (29 years, 8 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-0-base
Branch point for: netbsd-1-0
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored)

New RCS ID's, take two.  they're more aesthecially pleasant, and use 'NetBSD'

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jun 27 19:31:32 1994 UTC (29 years, 8 months ago) by cgd
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

new standard, minimally intrusive ID format

Revision 1.7 / (download) - annotate - [select for diffs], Fri May 13 06:12:05 1994 UTC (29 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.6: +51 -44 lines
Diff to previous 1.6 (colored)

Update to 4.4-Lite networking code, with a few local changes.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Apr 15 05:10:31 1994 UTC (29 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: nvm-base
Changes since 1.5: +22 -14 lines
Diff to previous 1.5 (colored)

more spl's so the mbuf counters don't go wacky, also repair cltom()

Revision 1.5 / (download) - annotate - [select for diffs], Wed Feb 9 20:54:46 1994 UTC (30 years, 1 month ago) by mycroft
Branch: MAIN
Branch point for: nvm
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

Format police.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Aug 3 01:50:21 1993 UTC (30 years, 7 months ago) by glass
Branch: MAIN
CVS Tags: magnum-base, magnum
Changes since 1.3: +20 -20 lines
Diff to previous 1.3 (colored)

getting rid of some "warning: `/*' within comment" problems

Revision 1.3 / (download) - annotate - [select for diffs], Thu May 20 16:22:39 1993 UTC (30 years, 10 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-0-9-patch-001, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored)

add rcs ids as necessary, and also clean up headers

Revision 1.2 / (download) - annotate - [select for diffs], Mon Apr 19 01:22:52 1993 UTC (30 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.1: +5 -0 lines
Diff to previous 1.1 (colored)

Add consistent multiple-inclusion protection.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (31 years ago) by cgd
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>