The NetBSD Project

CVS log for src/sys/netinet/ip_flow.c

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.86.2.1: download - view: text, markup, annotated - select for diffs
Wed Nov 4 23:27:59 2026 UTC (11 days, 6 hours ago) by perseant
Branches: perseant-exfatfs
Diff to: previous 1.86: preferred, colored; next MAIN 1.87: preferred, colored
Changes since revision 1.86: +5 -5 lines
Sync with HEAD

Revision 1.88: download - view: text, markup, annotated - select for diffs
Wed Oct 14 20:11:20 2026 UTC (4 weeks, 4 days ago) by joe
Branches: MAIN
CVS tags: perseant-exfatfs-base-20261102, HEAD
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +4 -4 lines
avoid shifting 32 bits in in a 32 bits integer in IP flow hashing

Revision 1.87: download - view: text, markup, annotated - select for diffs
Wed Dec 10 21:33:03 2025 UTC (11 months ago) by andvar
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +3 -3 lines
Fix various typos, mainly in comments.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Sat Jun 29 12:59:08 2024 UTC (2 years, 4 months ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20250801, perseant-exfatfs-base-20240630, perseant-exfatfs-base, netbsd-11-base, netbsd-11-1-RELEASE, netbsd-11-0-RELEASE, netbsd-11-0-RC7, netbsd-11-0-RC6, netbsd-11-0-RC5, netbsd-11-0-RC4, netbsd-11-0-RC3, netbsd-11-0-RC2, netbsd-11-0-RC1, netbsd-11
Branch point for: perseant-exfatfs
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +13 -11 lines
netinet: Use _NET_STAT* API instead of direct array access.

PR kern/58380

Revision 1.82.14.1: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:29:01 2021 UTC (5 years, 7 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.82: preferred, colored; next MAIN 1.83: preferred, colored
Changes since revision 1.82: +5 -6 lines
Sync with HEAD.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Fri Feb 19 14:51:59 2021 UTC (5 years, 8 months ago) by christos
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, 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, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-2-RELEASE, netbsd-10-1-RELEASE, netbsd-10-0-RELEASE, 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, 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
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +4 -4 lines
- 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.84: download - view: text, markup, annotated - select for diffs
Mon Feb 15 03:41:01 2021 UTC (5 years, 9 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +3 -3 lines
Fix build failure for options GATEWAY.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Sun Feb 14 20:58:35 2021 UTC (5 years, 9 months ago) by christos
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +5 -6 lines
- 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.81.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 16 02:00:08 2018 UTC (8 years, 7 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.81: preferred, colored; next MAIN 1.82: preferred, colored
Changes since revision 1.81: +7 -7 lines
Sync with HEAD, resolve some conflicts

Revision 1.82: download - view: text, markup, annotated - select for diffs
Wed Apr 11 08:29:19 2018 UTC (8 years, 7 months ago) by maxv
Branches: MAIN
CVS tags: phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, netbsd-9-base, netbsd-9-5-RELEASE, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: thorpej-futex
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +7 -7 lines
Remove whitespaces/tabs, and one non-ASCII character.

Revision 1.80.6.1: download - view: text, markup, annotated - select for diffs
Tue Jan 2 10:20:34 2018 UTC (8 years, 10 months ago) by snj
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Diff to: previous 1.80: preferred, colored; next MAIN 1.81: preferred, colored
Changes since revision 1.80: +10 -32 lines
Pull up following revision(s) (requested by ozaki-r in ticket #456):
	sys/arch/arm/sunxi/sunxi_emac.c: 1.9
	sys/dev/ic/dwc_gmac.c: 1.43-1.44
	sys/dev/pci/if_iwm.c: 1.75
	sys/dev/pci/if_wm.c: 1.543
	sys/dev/pci/ixgbe/ixgbe.c: 1.112
	sys/dev/pci/ixgbe/ixv.c: 1.74
	sys/kern/sys_socket.c: 1.75
	sys/net/agr/if_agr.c: 1.43
	sys/net/bpf.c: 1.219
	sys/net/if.c: 1.397, 1.399, 1.401-1.403, 1.406-1.410, 1.412-1.416
	sys/net/if.h: 1.242-1.247, 1.250, 1.252-1.257
	sys/net/if_bridge.c: 1.140 via patch, 1.142-1.146
	sys/net/if_etherip.c: 1.40
	sys/net/if_ethersubr.c: 1.243, 1.246
	sys/net/if_faith.c: 1.57
	sys/net/if_gif.c: 1.132
	sys/net/if_l2tp.c: 1.15, 1.17
	sys/net/if_loop.c: 1.98-1.101
	sys/net/if_media.c: 1.35
	sys/net/if_pppoe.c: 1.131-1.132
	sys/net/if_spppsubr.c: 1.176-1.177
	sys/net/if_tun.c: 1.142
	sys/net/if_vlan.c: 1.107, 1.109, 1.114-1.121
	sys/net/npf/npf_ifaddr.c: 1.3
	sys/net/npf/npf_os.c: 1.8-1.9
	sys/net/rtsock.c: 1.230
	sys/netcan/if_canloop.c: 1.3-1.5
	sys/netinet/if_arp.c: 1.255
	sys/netinet/igmp.c: 1.65
	sys/netinet/in.c: 1.210-1.211
	sys/netinet/in_pcb.c: 1.180
	sys/netinet/ip_carp.c: 1.92, 1.94
	sys/netinet/ip_flow.c: 1.81
	sys/netinet/ip_input.c: 1.362
	sys/netinet/ip_mroute.c: 1.147
	sys/netinet/ip_output.c: 1.283, 1.285, 1.287
	sys/netinet6/frag6.c: 1.61
	sys/netinet6/in6.c: 1.251, 1.255
	sys/netinet6/in6_pcb.c: 1.162
	sys/netinet6/ip6_flow.c: 1.35
	sys/netinet6/ip6_input.c: 1.183
	sys/netinet6/ip6_output.c: 1.196
	sys/netinet6/mld6.c: 1.90
	sys/netinet6/nd6.c: 1.239-1.240
	sys/netinet6/nd6_nbr.c: 1.139
	sys/netinet6/nd6_rtr.c: 1.136
	sys/netipsec/ipsec_output.c: 1.65
	sys/rump/net/lib/libnetinet/netinet_component.c: 1.9-1.10
kmem_intr_free kmem_intr_[z]alloced memory
the underlying pools are the same but api-wise those should match
Unify IFEF_*_MPSAFE into IFEF_MPSAFE
There are already two flags for if_output and if_start, however, it seems such
MPSAFE flags are eventually needed for all if_XXX operations. Having discrete
flags for each operation is wasteful of if_extflags bits. So let's unify
the flags into one: IFEF_MPSAFE.
Fortunately IFEF_*_MPSAFE flags have never been included in any releases, so
we can change them without breaking backward compatibility of the releases
(though the kernel version of -current should be bumped).
Note that if an interface have both MP-safe and non-MP-safe operations at a
time, we have to set the IFEF_MPSAFE flag and let callees of non-MP-safe
opeartions take the kernel lock.
Proposed on tech-kern@ and tech-net@
Provide macros for softnet_lock and KERNEL_LOCK hiding NET_MPSAFE switch
It reduces C&P codes such as "#ifndef NET_MPSAFE KERNEL_LOCK(1, NULL); ..."
scattered all over the source code and makes it easy to identify remaining
KERNEL_LOCK and/or softnet_lock that are held even if NET_MPSAFE.
No functional change
Hold KERNEL_LOCK on if_ioctl selectively based on IFEF_MPSAFE
If IFEF_MPSAFE is set, hold the lock and otherwise don't hold.
This change requires additions of KERNEL_LOCK to subsequence functions from
if_ioctl such as ifmedia_ioctl and ifioctl_common to protect non-MP-safe
components.
Proposed on tech-kern@ and tech-net@
Ensure to hold if_ioctl_lock when calling if_flags_set
Fix locking against myself on ifpromisc
vlan_unconfig_locked could be called with holding if_ioctl_lock.
Ensure to not turn on IFF_RUNNING of an interface until its initialization completes
And ensure to turn off it before destruction as per IFF_RUNNING's description
"resource allocated". (The description is a bit doubtful though, I believe the
change is still proper.)
Ensure to hold if_ioctl_lock on if_up and if_down
One exception for if_down is if_detach; in the case the lock isn't needed
because it's guaranteed that no other one can access ifp at that point.
Make if_link_queue MP-safe if IFEF_MPSAFE
if_link_queue is a queue to store events of link state changes, which is
used to pass events from (typically) an interrupt handler to
if_link_state_change softint. The queue was protected by KERNEL_LOCK so far,
but if IFEF_MPSAFE is enabled, it becomes unsafe because (perhaps) an interrupt
handler of an interface with IFEF_MPSAFE doesn't take KERNEL_LOCK. Protect it
by a spin mutex.
Additionally with this change KERNEL_LOCK of if_link_state_change softint is
omitted if NET_MPSAFE is enabled.
Note that the spin mutex is now ifp->if_snd.ifq_lock as well as the case of
if_timer (see the comment).
Use IFADDR_WRITER_FOREACH instead of IFADDR_READER_FOREACH
At that point no other one modifies the list so IFADDR_READER_FOREACH
is unnecessary. Use of IFADDR_READER_FOREACH is harmless in general though,
if we try to detect contract violations of pserialize, using it violates
the contract. So avoid using it makes life easy.
Ensure to call if_addr_init with holding if_ioctl_lock
Get rid of outdated comments
Fix build of kernels without ether
By throwing out if_enable_vlan_mtu and if_disable_vlan_mtu that
created a unnecessary dependency from if.c to if_ethersubr.c.
PR kern/52790
Rename IFNET_LOCK to IFNET_GLOBAL_LOCK
IFNET_LOCK will be used in another lock, if_ioctl_lock (might be renamed then).
Wrap if_ioctl_lock with IFNET_* macros (NFC)
Also if_ioctl_lock perhaps needs to be renamed to something because it's now
not just for ioctl...
Reorder some destruction routines in if_detach
- Destroy if_ioctl_lock at the end of the if_detach because it's used in various
  destruction routines
- Move psref_target_destroy after pr_purgeif because we want to use psref in
  pr_purgeif (otherwise destruction procedures can be tricky)
Ensure to call if_mcast_op with holding IFNET_LOCK
Note that CARP doesn't deal with IFNET_LOCK yet.
Remove IFNET_GLOBAL_LOCK where it's unnecessary because IFNET_LOCK is held
Describe which lock is used to protect each member variable of struct ifnet
Requested by skrll@
Write a guideline for converting an interface to IFEF_MPSAFE
Requested by skrll@
Note that IFNET_LOCK must not be held in softint
Don't set IFEF_MPSAFE unless NET_MPSAFE at this point
Because recent investigations show that interfaces with IFEF_MPSAFE need to
follow additional restrictions to work with the flag safely. We should enable it
on an interface by default only if the interface surely satisfies the
restrictions, which are described in if.h.
Note that enabling IFEF_MPSAFE solely gains a few benefit on performance because
the network stack is still serialized by the big kernel locks by default.

Revision 1.60.6.2: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:39:04 2017 UTC (8 years, 11 months ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.60.6.1: preferred, colored; branchpoint 1.60: preferred, colored; next MAIN 1.61: preferred, colored
Changes since revision 1.60.6.1: +187 -100 lines
update from HEAD

Revision 1.81: download - view: text, markup, annotated - select for diffs
Fri Nov 17 07:37:12 2017 UTC (9 years ago) by ozaki-r
Branches: MAIN
CVS tags: tls-maxphys-base-20171202, pgoyette-compat-base, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +10 -32 lines
Provide macros for softnet_lock and KERNEL_LOCK hiding NET_MPSAFE switch

It reduces C&P codes such as "#ifndef NET_MPSAFE KERNEL_LOCK(1, NULL); ..."
scattered all over the source code and makes it easy to identify remaining
KERNEL_LOCK and/or softnet_lock that are held even if NET_MPSAFE.

No functional change

Revision 1.65.2.6: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:53:12 2017 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.65.2.5: preferred, colored; branchpoint 1.65: preferred, colored; next MAIN 1.66: preferred, colored
Changes since revision 1.65.2.5: +4 -2 lines
Sync with HEAD

Revision 1.64.2.1: download - view: text, markup, annotated - select for diffs
Fri May 12 05:44:10 2017 UTC (9 years, 6 months ago) by snj
Branches: netbsd-7
CVS tags: netbsd-7-2-RELEASE
Diff to: previous 1.64: preferred, colored; next MAIN 1.65: preferred, colored
Changes since revision 1.64: +34 -4 lines
Pull up following revision(s) (requested by skrll/ozaki-r in ticket #1402):
	sys/net/route.c: revision 1.170 via patch
	sys/netinet/ip_flow.c: revision 1.73 via patch
	sys/netinet6/ip6_flow.c: revision 1.28 via patch
	sys/netinet6/nd6.c: revision 1.203 via patch
Run timers in workqueue
Timers (such as nd6_timer) typically free/destroy some data in callout
(softint). If we apply psz/psref for such data, we cannot do free/destroy
process in there because synchronization of psz/psref cannot be used in
softint. So run timer callbacks in workqueue works (normal LWP context).
Doing workqueue_enqueue a work twice (i.e., call workqueue_enqueue before
a previous task is scheduled) isn't allowed. For nd6_timer and
rt_timer_timer, this doesn't happen because callout_reset is called only
from workqueue's work. OTOH, ip{,6}flow_slowtimo's callout can be called
before its work starts and completes because the callout is periodically
called regardless of completion of the work. To avoid such a situation,
add a flag for each protocol; the flag is set true when a work is
enqueued and set false after the work finished. workqueue_enqueue is
called only if the flag is false.
Proposed on tech-net and tech-kern.

Revision 1.79.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:54:06 2017 UTC (9 years, 6 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.79: preferred, colored; next MAIN 1.80: preferred, colored
Changes since revision 1.79: +4 -2 lines
Sync with HEAD

Revision 1.73.2.4: download - view: text, markup, annotated - select for diffs
Mon Mar 20 06:57:50 2017 UTC (9 years, 7 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.73.2.3: preferred, colored; branchpoint 1.73: preferred, colored; next MAIN 1.74: preferred, colored
Changes since revision 1.73.2.3: +4 -5 lines
Sync with HEAD

Revision 1.80: download - view: text, markup, annotated - select for diffs
Tue Feb 7 02:38:08 2017 UTC (9 years, 9 months ago) by ozaki-r
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: netbsd-8
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +4 -2 lines
Add missing NULL checks for m_get_rcvif

Revision 1.65.2.5: download - view: text, markup, annotated - select for diffs
Sun Feb 5 13:40:59 2017 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.65.2.4: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.4: +23 -17 lines
Sync with HEAD

Revision 1.79: download - view: text, markup, annotated - select for diffs
Wed Jan 11 13:08:29 2017 UTC (9 years, 10 months ago) by ozaki-r
Branches: MAIN
CVS tags: nick-nhusb-base-20170204, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +2 -5 lines
Get rid of unnecessary header inclusions

Revision 1.73.2.3: download - view: text, markup, annotated - select for diffs
Sat Jan 7 08:56:51 2017 UTC (9 years, 10 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.73.2.2: preferred, colored; branchpoint 1.73: preferred, colored
Changes since revision 1.73.2.2: +22 -13 lines
Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.78: download - view: text, markup, annotated - select for diffs
Thu Dec 8 05:16:33 2016 UTC (9 years, 11 months ago) by ozaki-r
Branches: MAIN
CVS tags: pgoyette-localcount-20170107
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +22 -13 lines
Add rtcache_unref to release points of rtentry stemming from rtcache

In the MP-safe world, a rtentry stemming from a rtcache can be freed at any
points. So we need to protect rtentries somehow say by reference couting or
passive references. Regardless of the method, we need to call some release
function of a rtentry after using it.

The change adds a new function rtcache_unref to release a rtentry. At this
point, this function does nothing because for now we don't add a reference
to a rtentry when we get one from a rtcache. We will add something useful
in a further commit.

This change is a part of changes for MP-safe routing table. It is separated
to avoid one big change that makes difficult to debug by bisecting.

Revision 1.65.2.4: download - view: text, markup, annotated - select for diffs
Mon Dec 5 10:55:28 2016 UTC (9 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.65.2.3: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.3: +30 -16 lines
Sync with HEAD

Revision 1.73.2.2: download - view: text, markup, annotated - select for diffs
Fri Nov 4 14:49:21 2016 UTC (10 years ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.73.2.1: preferred, colored; branchpoint 1.73: preferred, colored
Changes since revision 1.73.2.1: +30 -16 lines
Sync with HEAD

Revision 1.77: download - view: text, markup, annotated - select for diffs
Tue Oct 18 07:30:31 2016 UTC (10 years, 1 month ago) by ozaki-r
Branches: MAIN
CVS tags: pgoyette-localcount-20161104, nick-nhusb-base-20161204
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +30 -16 lines
Don't hold global locks if NET_MPSAFE is enabled

If NET_MPSAFE is enabled, don't hold KERNEL_LOCK and softnet_lock in
part of the network stack such as IP forwarding paths. The aim of the
change is to make it easy to test the network stack without the locks
and reduce our local diffs.

By default (i.e., if NET_MPSAFE isn't enabled), the locks are held
as they used to be.

Reviewed by knakahara@

Revision 1.65.2.3: download - view: text, markup, annotated - select for diffs
Wed Oct 5 20:56:09 2016 UTC (10 years, 1 month ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.65.2.2: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.2: +95 -43 lines
Sync with HEAD

Revision 1.73.2.1: download - view: text, markup, annotated - select for diffs
Sat Aug 6 00:19:10 2016 UTC (10 years, 3 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +67 -45 lines
Sync with HEAD

Revision 1.76: download - view: text, markup, annotated - select for diffs
Mon Aug 1 10:22:53 2016 UTC (10 years, 3 months ago) by knakahara
Branches: MAIN
CVS tags: pgoyette-localcount-20160806, nick-nhusb-base-20161004, localcount-20160914
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +61 -33 lines
improve fast-forward performance when the number of flows exceeds IPFLOW_MAX.

In the fast-forward case, when the number of flows exceeds IPFLOW_MAX, the
performmance degraded to about 50% compared to the case less than IPFLOW_MAX
flows. This modification suppresses the degradation to 65%. Furthermore,
the modified kernel is about the same performance as the original kernel
when the number of flows is less than IPFLOW_MAX.

The original patch is implemented by ryo@n.o. Thanks.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Wed Jul 27 04:23:42 2016 UTC (10 years, 3 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +2 -6 lines
remove extra ifdefs. no functional changes.

ip_flow.c becomes build target only if GATEWAY kernel option is on.
So, "#ifdef GATEWAY" in ip_flow.c is not needed.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Tue Jul 26 05:53:30 2016 UTC (10 years, 3 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +8 -10 lines
Simplify by using atomic_swap instead of mutex

Suggested by kefren@

Revision 1.73: download - view: text, markup, annotated - select for diffs
Mon Jul 11 07:37:00 2016 UTC (10 years, 4 months ago) by ozaki-r
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20160726
Branch point for: pgoyette-localcount
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +34 -4 lines
Run timers in workqueue

Timers (such as nd6_timer) typically free/destroy some data in callout
(softint). If we apply psz/psref for such data, we cannot do free/destroy
process in there because synchronization of psz/psref cannot be used in
softint. So run timer callbacks in workqueue works (normal LWP context).

Doing workqueue_enqueue a work twice (i.e., call workqueue_enqueue before
a previous task is scheduled) isn't allowed. For nd6_timer and
rt_timer_timer, this doesn't happen because callout_reset is called only
from workqueue's work. OTOH, ip{,6}flow_slowtimo's callout can be called
before its work starts and completes because the callout is periodically
called regardless of completion of the work. To avoid such a situation,
add a flag for each protocol; the flag is set true when a work is
enqueued and set false after the work finished. workqueue_enqueue is
called only if the flag is false.

Proposed on tech-net and tech-kern.

Revision 1.65.2.2: download - view: text, markup, annotated - select for diffs
Sat Jul 9 20:25:22 2016 UTC (10 years, 4 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.65.2.1: preferred, colored; branchpoint 1.65: preferred, colored
Changes since revision 1.65.2.1: +70 -36 lines
Sync with HEAD

Revision 1.72: download - view: text, markup, annotated - select for diffs
Mon Jun 20 06:46:38 2016 UTC (10 years, 4 months ago) by knakahara
Branches: MAIN
CVS tags: nick-nhusb-base-20160907
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +3 -5 lines
apply if_output_lock() to L3 callers which call ifp->if_output() of L2(or L3 tunneling).

Revision 1.71: download - view: text, markup, annotated - select for diffs
Mon Jun 13 08:37:15 2016 UTC (10 years, 5 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +6 -16 lines
eliminate unnecessary splnet

Revision 1.70: download - view: text, markup, annotated - select for diffs
Mon Jun 13 08:34:23 2016 UTC (10 years, 5 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +54 -12 lines
MP-ify fastforward to support GATEWAY kernel option.

I add "ipflow_lock" mutex in ip_flow.c and "ip6flow_lock" mutex in ip6_flow.c
to protect all data in each file. Of course, this is not MP-scalable. However,
it is sufficient as tentative workaround. We should make it scalable somehow
in the future.

ok by ozaki-r@n.o.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Mon Jun 13 08:29:55 2016 UTC (10 years, 5 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +4 -3 lines
make ipflow_reap() static function.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Mon Jun 13 08:04:44 2016 UTC (10 years, 5 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +2 -6 lines
remove unnecessary splnet before pool_{get,put}

Revision 1.67: download - view: text, markup, annotated - select for diffs
Fri Jun 10 13:31:44 2016 UTC (10 years, 5 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +13 -6 lines
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.65.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 6 15:18:23 2015 UTC (11 years, 7 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +4 -3 lines
Sync with HEAD

Revision 1.66: download - view: text, markup, annotated - select for diffs
Mon Mar 23 18:33:17 2015 UTC (11 years, 7 months ago) by roy
Branches: MAIN
CVS tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +4 -3 lines
Add RTF_BROADCAST to mark routes used for the broadcast address when
they are created on the fly. This makes it clear what the route is for
and allows an optimisation in ip_output() by avoiding a call to
in_broadcast() because most of the time we do talk to a host.
It also avoids a needless allocation for the storage of llinfo_arp and
thus vanishes from arp(8) - it showed as incomplete anyway so this
is a nice side effect.

Guard against this and routes marked with RTF_BLACKHOLE in
ip_fastforward().
While here, guard against routes marked with RTF_BLACKHOLE in
ip6_fastforward().
RTF_BROADCAST is IPv4 only, so don't bother checking that here.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sat Oct 18 08:33:29 2014 UTC (12 years, 1 month ago) by snj
Branches: MAIN
CVS tags: nick-nhusb-base
Branch point for: nick-nhusb
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +4 -4 lines
src is too big these days to tolerate superfluous apostrophes.  It's
"its", people!

Revision 1.60.6.1: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:04:35 2014 UTC (12 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +118 -30 lines
Rebase to HEAD as of a few days ago.

Revision 1.63.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 06:56:25 2014 UTC (12 years, 3 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.63: preferred, colored; next MAIN 1.64: preferred, colored
Changes since revision 1.63: +110 -7 lines
Rebase.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Thu May 22 22:01:12 2014 UTC (12 years, 5 months ago) by rmind
Branches: MAIN
CVS tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, 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-1, 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, netbsd-7-0
Branch point for: netbsd-7
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +110 -7 lines
- Add in_init() and move some functions, variables and sysctls into in.c
  where they belong to.  Make some functions and variables static.
- ip_input.c: reduce some #ifdefs, cleanup a little.
- Move some sysctls into ip_flow.c as they belong there.

No functional change.

Revision 1.59.8.2: download - view: text, markup, annotated - select for diffs
Thu May 22 11:41:09 2014 UTC (12 years, 5 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.59.8.1: preferred, colored; branchpoint 1.59: preferred, colored; next MAIN 1.60: preferred, colored
Changes since revision 1.59.8.1: +10 -25 lines
sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.60.10.2: download - view: text, markup, annotated - select for diffs
Sun May 18 17:46:13 2014 UTC (12 years, 6 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.60.10.1: preferred, colored; branchpoint 1.60: preferred, colored; next MAIN 1.61: preferred, colored
Changes since revision 1.60.10.1: +4 -4 lines
sync with head

Revision 1.63: download - view: text, markup, annotated - select for diffs
Tue Apr 1 13:11:44 2014 UTC (12 years, 7 months ago) by pooka
Branches: MAIN
CVS tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Branch point for: tls-earlyentropy
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +9 -3 lines
Wrap ipflow_create() & ip6flow_create() in kernel lock.  Prevents the
interrupt side on another core from seeing the situation while the ipflow
is being modified.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Wed Mar 19 10:54:20 2014 UTC (12 years, 8 months ago) by liamjfoy
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +3 -17 lines
Move ipflow into ip_var.h and fix confliction

Revision 1.61: download - view: text, markup, annotated - select for diffs
Wed Mar 19 08:27:21 2014 UTC (12 years, 8 months ago) by liamjfoy
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +2 -9 lines
Remove ipflow_prune and replace with ipflow_reap. ok rmind@

Revision 1.60.10.1: download - view: text, markup, annotated - select for diffs
Wed Jul 17 03:16:31 2013 UTC (13 years, 4 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +335 -197 lines
Checkpoint work in progress:
- Move PCB structures under __INPCB_PRIVATE, adjust most of the callers
  and thus make IPv4 PCB structures mostly opaque.  Any volunteers for
  merging in6pcb with inpcb (see rpaulo-netinet-merge-pcb branch)?
- Move various global vars to the modules where they belong, make them static.
- Some preliminary work for IPv4 PCB locking scheme.
- Make raw IP code mostly MP-safe.  Simplify some of it.
- Rework "fast" IP forwarding (ipflow) code to be mostly MP-safe.  It should
  run from a software interrupt, rather than hard.
- Rework tun(4) pseudo interface to be MP-safe.
- Work towards making some other interfaces more strict.

Revision 1.59.8.1: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:08:40 2012 UTC (14 years, 7 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +3 -4 lines
sync with head

Revision 1.59.12.1: download - view: text, markup, annotated - select for diffs
Sat Feb 18 07:35:39 2012 UTC (14 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.59: preferred, colored; next MAIN 1.60: preferred, colored
Changes since revision 1.59: +3 -4 lines
merge to -current.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Thu Jan 19 13:13:48 2012 UTC (14 years, 10 months ago) by liamjfoy
Branches: MAIN
CVS tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, 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, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, khorben-n900, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, agc-symver-base, agc-symver
Branch point for: tls-maxphys, rmind-smpnet
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +3 -4 lines
Remove ipf_start from ipf struct

Revision 1.55.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:54:56 2010 UTC (16 years, 3 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.55.2.2: preferred, colored; branchpoint 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55.2.2: +4 -2 lines
sync with head.

Revision 1.58.4.1: download - view: text, markup, annotated - select for diffs
Sun May 30 05:18:02 2010 UTC (16 years, 5 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.58: preferred, colored; next MAIN 1.59: preferred, colored
Changes since revision 1.58: +4 -2 lines
sync with head

Revision 1.58.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 30 14:44:20 2010 UTC (16 years, 6 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.58: preferred, colored; next MAIN 1.59: preferred, colored
Changes since revision 1.58: +4 -2 lines
Sync with HEAD.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Apr 1 00:24:41 2010 UTC (16 years, 7 months ago) by tls
Branches: MAIN
CVS tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, rmind-uvmplock-nbase, rmind-uvmplock-base, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache, jmcneill-usbmp
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +4 -2 lines
After discussion with ad@: it appears that KERNEL_LOCK also protects
the driver output path (that is, ifp->if_output()).  In the case of
entry through the socket code, we are fine, because pru_usrreq takes
KERNEL_LOCK.  However, there are a few other ways to cause output
which require protection:

	1) direct calls to tcp_output() in tcp_input()
	2) fast-forwarding code (ip_flow) -- protected elsewise
	   against itself by the softnet lock.
	3) *Possibly* the ARP code.  I have currently persuaded
	   myself that it is safe because of how it's called.
	4) Possibly the ICMP code.

This change addresses #1 and #2.

Revision 1.57.2.1: download - view: text, markup, annotated - select for diffs
Wed May 13 17:22:28 2009 UTC (17 years, 6 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.57: preferred, colored; next MAIN 1.58: preferred, colored
Changes since revision 1.57: +3 -3 lines
Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.55.2.2: download - view: text, markup, annotated - select for diffs
Mon May 4 08:14:17 2009 UTC (17 years, 6 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.55.2.1: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.1: +11 -4 lines
sync with head.

Revision 1.56.8.2: download - view: text, markup, annotated - select for diffs
Tue Apr 28 07:37:22 2009 UTC (17 years, 6 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.56.8.1: preferred, colored; branchpoint 1.56: preferred, colored; next MAIN 1.57: preferred, colored
Changes since revision 1.56.8.1: +3 -3 lines
Sync with HEAD.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sun Mar 15 22:16:09 2009 UTC (17 years, 8 months ago) by cegger
Branches: 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, uebayasi-xip-base, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, matt-premerge-20091211, jymxensuspend-base, jym-xensuspend-nbase, jym-xensuspend-base
Branch point for: uebayasi-xip, rmind-uvmplock
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +3 -3 lines
ansify function definitions

Revision 1.56.8.1: download - view: text, markup, annotated - select for diffs
Tue Mar 3 18:33:38 2009 UTC (17 years, 8 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +11 -4 lines
Sync with HEAD.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sun Feb 1 17:04:11 2009 UTC (17 years, 9 months ago) by pooka
Branches: MAIN
CVS tags: nick-hppapmap-base2
Branch point for: jym-xensuspend
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +11 -4 lines
Init ipflow pool dynamically instead of using a linkset.

Revision 1.51.6.1: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:24:24 2008 UTC (18 years, 5 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.51: preferred, colored; next MAIN 1.52: preferred, colored
Changes since revision 1.51: +48 -19 lines
Sync with HEAD.

Revision 1.54.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 12:35:29 2008 UTC (18 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.54: preferred, colored; next MAIN 1.55: preferred, colored
Changes since revision 1.54: +6 -9 lines
sync with head.

Revision 1.55.2.1: download - view: text, markup, annotated - select for diffs
Fri May 16 02:25:41 2008 UTC (18 years, 6 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +2 -9 lines
sync with head.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Mon Apr 28 20:24:09 2008 UTC (18 years, 6 months ago) by martin
Branches: MAIN
CVS tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, 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-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-base2, hpcarm-cleanup-nbase, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +2 -9 lines
Remove clause 3 and 4 from TNF licenses

Revision 1.55: download - view: text, markup, annotated - select for diffs
Thu Apr 24 11:38:37 2008 UTC (18 years, 6 months ago) by ad
Branches: MAIN
CVS tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +6 -2 lines
Merge the socket locking patch:

- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sat Apr 12 05:58:22 2008 UTC (18 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +17 -9 lines
Make IP, TCP, UDP, and ICMP statistics per-CPU.  The stats are collated
when the user requests them via sysctl.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Wed Apr 9 05:14:20 2008 UTC (18 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +29 -5 lines
- ipflow is not used outside ip_flow.c; move its definition there.
- Make ipflow_reap() private to ip_flow.c, and introduce ipflow_prune()
  for external callers to use (avoids returning an ipflow * that is never
  actually used anyway).

Revision 1.52: download - view: text, markup, annotated - select for diffs
Mon Apr 7 06:31:28 2008 UTC (18 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +9 -9 lines
Change IP stats from a structure to an array of uint64_t's.

Note: This is ABI-compatible with the old ipstat structure; old netstat
binaries will continue to work properly.

Revision 1.48.8.1: download - view: text, markup, annotated - select for diffs
Mon Feb 18 21:07:08 2008 UTC (18 years, 9 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.48: preferred, colored; next MAIN 1.49: preferred, colored
Changes since revision 1.48: +18 -14 lines
Sync with HEAD.

Revision 1.29.6.5: download - view: text, markup, annotated - select for diffs
Mon Jan 21 09:47:15 2008 UTC (18 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.29.6.4: preferred, colored; branchpoint 1.29: preferred, colored; next MAIN 1.30: preferred, colored
Changes since revision 1.29.6.4: +20 -15 lines
sync with head

Revision 1.48.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 9 01:57:27 2008 UTC (18 years, 10 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.48: preferred, colored; next MAIN 1.49: preferred, colored
Changes since revision 1.48: +20 -15 lines
sync with HEAD

Revision 1.48.14.2: download - view: text, markup, annotated - select for diffs
Tue Jan 8 22:11:50 2008 UTC (18 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
CVS tags: bouyer-xeni386-merge1
Diff to: previous 1.48.14.1: preferred, colored; branchpoint 1.48: preferred, colored; next MAIN 1.49: preferred, colored
Changes since revision 1.48.14.1: +13 -13 lines
Sync with HEAD

Revision 1.51: download - view: text, markup, annotated - select for diffs
Fri Jan 4 23:28:07 2008 UTC (18 years, 10 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base, ad-socklock-base1
Branch point for: mjf-devfs2
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +11 -8 lines
Constify a bit.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Fri Jan 4 23:26:44 2008 UTC (18 years, 10 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +6 -9 lines
Replace rtcache_down() with rtcache_validate() and update rtcache_down()
uses.

Revision 1.48.14.1: download - view: text, markup, annotated - select for diffs
Wed Jan 2 21:57:20 2008 UTC (18 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +13 -8 lines
Sync with HEAD

Revision 1.48.10.1: download - view: text, markup, annotated - select for diffs
Wed Dec 26 19:57:39 2007 UTC (18 years, 10 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.48: preferred, colored; next MAIN 1.49: preferred, colored
Changes since revision 1.48: +13 -8 lines
Sync with head.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Thu Dec 20 19:53:32 2007 UTC (18 years, 11 months ago) by dyoung
Branches: MAIN
CVS tags: vmlocking2-base3
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +13 -8 lines
Poison struct route->ro_rt uses in the kernel by changing the name
to _ro_rt.  Use rtcache_getrt() to access a route cache's struct
rtentry *.

Introduce struct ifnet->if_dl that always points at the interface
identifier/link-layer address.  Make code that treated the first
ifaddr on struct ifnet->if_addrlist as the interface address use
if_dl, instead.

Remove stale debugging code from net/route.c.  Move the rtflush()
code into rtcache_clear() and delete rtflush().  Delete rtalloc(),
because nothing uses it any more.

Make ND6_HINT an inline, lowercase subroutine, nd6_hint.

I've done my best to convert IP Filter, the ISO stack, and the
AppleTalk stack to rtcache_getrt().  They compile, but I have not
tested them.  I have given the changes to PF, GRE, IPv4 and IPv6
stacks a lot of exercise.

Revision 1.41.2.4: download - view: text, markup, annotated - select for diffs
Tue Oct 9 13:44:49 2007 UTC (19 years, 1 month ago) by ad
Branches: vmlocking
Diff to: previous 1.41.2.3: preferred, colored; next MAIN 1.42: preferred, colored
Changes since revision 1.41.2.3: +8 -11 lines
Sync with head.

Revision 1.47.6.1: download - view: text, markup, annotated - select for diffs
Mon Sep 3 16:49:03 2007 UTC (19 years, 2 months ago) by jmcneill
Branches: jmcneill-pm
Diff to: previous 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47: +8 -11 lines
Sync with HEAD.

Revision 1.29.6.4: download - view: text, markup, annotated - select for diffs
Mon Sep 3 14:42:50 2007 UTC (19 years, 2 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.29.6.3: preferred, colored; branchpoint 1.29: preferred, colored
Changes since revision 1.29.6.3: +67 -40 lines
sync with head.

Revision 1.47.2.1: download - view: text, markup, annotated - select for diffs
Mon Sep 3 10:23:44 2007 UTC (19 years, 2 months ago) by skrll
Branches: nick-csl-alignment
Diff to: previous 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47: +8 -11 lines
Sync with HEAD.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Mon Aug 20 19:42:34 2007 UTC (19 years, 3 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, vmlocking-base, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-csl-alignment-base5, matt-armv6-prevmlocking, jmcneill-pm-base, jmcneill-base, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: vmlocking2, mjf-devfs, matt-armv6, bouyer-xeni386
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +8 -11 lines
Don't call rtcache_check() from the fast-forward code, which runs
at IPL_NET, because rtcache_check() may read the forwarding table.
Elsewhere, the kernel only blocks interrupts at priority IPL_SOFTNET
and below while it modifies the forwarding table, so rtcache_check()
could be reading the table in an inconsistent state.  Use
rtcache_done(), instead.

XXX netinet/ip_flow.c and netinet6/ip6_flow.c are virtually identical.
XXX They should share code.

Revision 1.42.2.1: download - view: text, markup, annotated - select for diffs
Wed Jul 11 20:11:23 2007 UTC (19 years, 4 months ago) by mjf
Branches: mjf-ufs-trans
Diff to: previous 1.42: preferred, colored; next MAIN 1.43: preferred, colored
Changes since revision 1.42: +55 -26 lines
Sync with head.

Revision 1.41.2.3: download - view: text, markup, annotated - select for diffs
Fri Jun 8 14:17:45 2007 UTC (19 years, 5 months ago) by ad
Branches: vmlocking
Diff to: previous 1.41.2.2: preferred, colored
Changes since revision 1.41.2.2: +3 -4 lines
Sync with head.

Revision 1.39.2.5: download - view: text, markup, annotated - select for diffs
Mon May 7 10:55:59 2007 UTC (19 years, 6 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.39.2.4: preferred, colored; branchpoint 1.39: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39.2.4: +3 -4 lines
sync with head.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Wed May 2 22:39:04 2007 UTC (19 years, 6 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-idlelwp-base8, nick-csl-alignment-base, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: nick-csl-alignment, jmcneill-pm
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +2 -3 lines
Remove obsolete files netinet/in_route.[ch].

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed May 2 20:40:24 2007 UTC (19 years, 6 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +3 -3 lines
Eliminate address family-specific route caches (struct route, struct
route_in6, struct route_iso), replacing all caches with a struct
route.

The principle benefit of this change is that all of the protocol
families can benefit from route cache-invalidation, which is
necessary for correct routing.  Route-cache invalidation fixes an
ancient PR, kern/3508, at long last; it fixes various other PRs,
also.

Discussions with and ideas from Joerg Sonnenberger influenced this
work tremendously.  Of course, all design oversights and bugs are
mine.

DETAILS

1 I added to each address family a pool of sockaddrs.  I have
  introduced routines for allocating, copying, and duplicating,
  and freeing sockaddrs:

        struct sockaddr *sockaddr_alloc(sa_family_t af, int flags);
        struct sockaddr *sockaddr_copy(struct sockaddr *dst,
                                       const struct sockaddr *src);
        struct sockaddr *sockaddr_dup(const struct sockaddr *src, int flags);
        void sockaddr_free(struct sockaddr *sa);

  sockaddr_alloc() returns either a sockaddr from the pool belonging
  to the specified family, or NULL if the pool is exhausted.  The
  returned sockaddr has the right size for that family; sa_family
  and sa_len fields are initialized to the family and sockaddr
  length---e.g., sa_family = AF_INET and sa_len = sizeof(struct
  sockaddr_in).  sockaddr_free() puts the given sockaddr back into
  its family's pool.

  sockaddr_dup() and sockaddr_copy() work analogously to strdup()
  and strcpy(), respectively.  sockaddr_copy() KASSERTs that the
  family of the destination and source sockaddrs are alike.

  The 'flags' argumet for sockaddr_alloc() and sockaddr_dup() is
  passed directly to pool_get(9).

2 I added routines for initializing sockaddrs in each address
  family, sockaddr_in_init(), sockaddr_in6_init(), sockaddr_iso_init(),
  etc.  They are fairly self-explanatory.

3 structs route_in6 and route_iso are no more.  All protocol families
  use struct route.  I have changed the route cache, 'struct route',
  so that it does not contain storage space for a sockaddr.  Instead,
  struct route points to a sockaddr coming from the pool the sockaddr
  belongs to.  I added a new method to struct route, rtcache_setdst(),
  for setting the cache destination:

        int rtcache_setdst(struct route *, const struct sockaddr *);

  rtcache_setdst() returns 0 on success, or ENOMEM if no memory is
  available to create the sockaddr storage.

  It is now possible for rtcache_getdst() to return NULL if, say,
  rtcache_setdst() failed.  I check the return value for NULL
  everywhere in the kernel.

4 Each routing domain (struct domain) has a list of live route
  caches, dom_rtcache.  rtflushall(sa_family_t af) looks up the
  domain indicated by 'af', walks the domain's list of route caches
  and invalidates each one.

Revision 1.39.2.4: download - view: text, markup, annotated - select for diffs
Sun Apr 15 16:04:00 2007 UTC (19 years, 7 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.39.2.3: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.3: +54 -24 lines
sync with head.

Revision 1.41.2.2: download - view: text, markup, annotated - select for diffs
Tue Apr 10 13:26:49 2007 UTC (19 years, 7 months ago) by ad
Branches: vmlocking
Diff to: previous 1.41.2.1: preferred, colored
Changes since revision 1.41.2.1: +54 -24 lines
Sync with head.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Thu Apr 5 18:11:47 2007 UTC (19 years, 7 months ago) by liamjfoy
Branches: MAIN
CVS tags: thorpej-atomic-base, thorpej-atomic
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +19 -15 lines
use size_t for indexes

just pass a *ip to ipflow_hash instead of members

ok christos@

Revision 1.42.4.1: download - view: text, markup, annotated - select for diffs
Thu Mar 29 19:28:00 2007 UTC (19 years, 7 months ago) by reinoud
Branches: reinoud-bufcleanup
Diff to: previous 1.42: preferred, colored; next MAIN 1.43: preferred, colored
Changes since revision 1.42: +37 -11 lines
Pullup to -current

Revision 1.44: download - view: text, markup, annotated - select for diffs
Mon Mar 26 00:29:15 2007 UTC (19 years, 7 months ago) by liamjfoy
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +6 -2 lines
Add a small note regarding further commented code in netinet6/ip6_flow.c

Revision 1.43: download - view: text, markup, annotated - select for diffs
Sun Mar 25 20:12:20 2007 UTC (19 years, 7 months ago) by liamjfoy
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +33 -11 lines
Add net.inet.ip.hashsize to control the IPv4 fast forward hash table size.

Revision 1.39.2.3: download - view: text, markup, annotated - select for diffs
Sat Mar 24 14:56:10 2007 UTC (19 years, 7 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.39.2.2: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.2: +4 -3 lines
sync with head.

Revision 1.41.2.1: download - view: text, markup, annotated - select for diffs
Tue Mar 13 16:52:01 2007 UTC (19 years, 8 months ago) by ad
Branches: vmlocking
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +4 -3 lines
Sync with head.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Mon Mar 12 18:18:35 2007 UTC (19 years, 8 months ago) by ad
Branches: MAIN
Branch point for: reinoud-bufcleanup, mjf-ufs-trans
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +4 -3 lines
Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.

Revision 1.39.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 12 05:59:37 2007 UTC (19 years, 8 months ago) by rmind
Branches: yamt-idlelwp
Diff to: previous 1.39.2.1: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.1: +6 -6 lines
Sync with HEAD.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun Mar 4 06:03:21 2007 UTC (19 years, 8 months ago) by christos
Branches: MAIN
Branch point for: vmlocking
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +6 -6 lines
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.39.2.1: download - view: text, markup, annotated - select for diffs
Tue Feb 27 16:54:55 2007 UTC (19 years, 8 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +4 -4 lines
- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.29.6.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 09:11:44 2007 UTC (19 years, 8 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.29.6.2: preferred, colored; branchpoint 1.29: preferred, colored
Changes since revision 1.29.6.2: +5 -5 lines
sync with head.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Sat Feb 17 22:34:11 2007 UTC (19 years, 9 months ago) by dyoung
Branches: MAIN
CVS tags: ad-audiomp-base, ad-audiomp
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +4 -4 lines
KNF: de-__P, bzero -> memset, bcmp -> memcmp.  Remove extraneous
   parentheses in return statements.

Cosmetic: don't open-code TAILQ_FOREACH().

Cosmetic: change types of variables to avoid oodles of casts: in
   in6_src.c, avoid casts by changing several route_in6 pointers
   to struct route pointers.  Remove unnecessary casts to caddr_t
   elsewhere.

Pave the way for eliminating address family-specific route caches:
   soon, struct route will not embed a sockaddr, but it will hold
   a reference to an external sockaddr, instead.  We will set the
   destination sockaddr using rtcache_setdst().  (I created a stub
   for it, but it isn't used anywhere, yet.)  rtcache_free() will
   free the sockaddr.  I have extracted from rtcache_free() a helper
   subroutine, rtcache_clear().  rtcache_clear() will "forget" a
   cached route, but it will not forget the destination by releasing
   the sockaddr.  I use rtcache_clear() instead of rtcache_free()
   in rtcache_update(), because rtcache_update() is not supposed
   to forget the destination.

Constify:

   1 Introduce const accessor for route->ro_dst, rtcache_getdst().

   2 Constify the 'dst' argument to ifnet->if_output().  This
     led me to constify a lot of code called by output routines.

   3 Constify the sockaddr argument to protosw->pr_ctlinput.  This
     led me to constify a lot of code called by ctlinput routines.

   4 Introduce const macros for converting from a generic sockaddr
     to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
     satocsin, et cetera.

Revision 1.34.2.3: download - view: text, markup, annotated - select for diffs
Thu Feb 1 08:48:43 2007 UTC (19 years, 9 months ago) by ad
Branches: newlock2
Diff to: previous 1.34.2.2: preferred, colored; branchpoint 1.34: preferred, colored; next MAIN 1.35: preferred, colored
Changes since revision 1.34.2.2: +3 -3 lines
Sync with head.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Fri Jan 26 19:12:21 2007 UTC (19 years, 9 months ago) by dyoung
Branches: MAIN
CVS tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Branch point for: yamt-idlelwp
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +3 -3 lines
bzero -> memset

Revision 1.34.2.2: download - view: text, markup, annotated - select for diffs
Fri Jan 12 01:04:14 2007 UTC (19 years, 10 months ago) by ad
Branches: newlock2
Diff to: previous 1.34.2.1: preferred, colored; branchpoint 1.34: preferred, colored
Changes since revision 1.34.2.1: +17 -12 lines
Sync with head.

Revision 1.29.6.2: download - view: text, markup, annotated - select for diffs
Sat Dec 30 20:50:33 2006 UTC (19 years, 10 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.29.6.1: preferred, colored; branchpoint 1.29: preferred, colored
Changes since revision 1.29.6.1: +23 -12 lines
sync with head.

Revision 1.34.4.3: download - view: text, markup, annotated - select for diffs
Mon Dec 18 11:42:21 2006 UTC (19 years, 11 months ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.34.4.2: preferred, colored; branchpoint 1.34: preferred, colored; next MAIN 1.35: preferred, colored
Changes since revision 1.34.4.2: +12 -19 lines
sync with head.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Fri Dec 15 21:18:53 2006 UTC (19 years, 11 months ago) by joerg
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +12 -19 lines
Introduce new helper functions to abstract the route caching.
rtcache_init and rtcache_init_noclone lookup ro_dst and store
the result in ro_rt, taking care of the reference counting and
calling the domain specific route cache.
rtcache_free checks if a route was cashed and frees the reference.
rtcache_copy copies ro_dst of the given struct route, checking that
enough space is available and incrementing the reference count of the
cached rtentry if necessary.
rtcache_check validates that the cached route is still up. If it isn't,
it tries to look it up again. Afterwards ro_rt is either a valid again
or NULL.
rtcache_copy is used internally.

Adjust to callers of rtalloc/rtflush in the tree to check the sanity of
ro_dst first (if necessary). If it doesn't fit the expectations, free
the cache, otherwise check if the cached route is still valid. After
that combination, a single check for ro_rt == NULL is enough to decide
whether a new lookup needs to be done with a different ro_dst.
Make the route checking in gre stricter by repeating the loop check
after revalidation.
Remove some unused RADIX_MPATH code in in6_src.c. The logic is slightly
changed here to first validate the route and check RTF_GATEWAY
afterwards. This is sementically equivalent though.
etherip doesn't need sc_route_expire similiar to the gif changes from
dyoung@ earlier.

Based on the earlier patch from dyoung@, reviewed and discussed with
him.

Revision 1.34.4.2: download - view: text, markup, annotated - select for diffs
Sun Dec 10 07:19:10 2006 UTC (19 years, 11 months ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.34.4.1: preferred, colored; branchpoint 1.34: preferred, colored
Changes since revision 1.34.4.1: +21 -9 lines
sync with head.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat Dec 9 05:33:04 2006 UTC (19 years, 11 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-splraiseipl-base3
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +21 -9 lines
Here are various changes designed to protect against bad IPv4
routing caused by stale route caches (struct route).  Route caches
are sprinkled throughout PCBs, the IP fast-forwarding table, and
IP tunnel interfaces (gre, gif, stf).

Stale IPv6 and ISO route caches will be treated by separate patches.

Thank you to Christoph Badura for suggesting the general approach
to invalidating route caches that I take here.

Here are the details:

Add hooks to struct domain for tracking and for invalidating each
domain's route caches: dom_rtcache, dom_rtflush, and dom_rtflushall.

Introduce helper subroutines, rtflush(ro) for invalidating a route
cache, rtflushall(family) for invalidating all route caches in a
routing domain, and rtcache(ro) for notifying the domain of a new
cached route.

Chain together all IPv4 route caches where ro_rt != NULL.  Provide
in_rtcache() for adding a route to the chain.  Provide in_rtflush()
and in_rtflushall() for invalidating IPv4 route caches.  In
in_rtflush(), set ro_rt to NULL, and remove the route from the
chain.  In in_rtflushall(), walk the chain and remove every route
cache.

In rtrequest1(), call rtflushall() to invalidate route caches when
a route is added.

In gif(4), discard the workaround for stale caches that involves
expiring them every so often.

Replace the pattern 'RTFREE(ro->ro_rt); ro->ro_rt = NULL;' with a
call to rtflush(ro).

Update ipflow_fastforward() and all other users of route caches so
that they expect a cached route, ro->ro_rt, to turn to NULL.

Take care when moving a 'struct route' to rtflush() the source and
to rtcache() the destination.

In domain initializers, use .dom_xxx tags.

KNF here and there.

Revision 1.34.2.1: download - view: text, markup, annotated - select for diffs
Sat Nov 18 21:39:36 2006 UTC (20 years ago) by ad
Branches: newlock2
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +6 -2 lines
Sync with head.

Revision 1.34.4.1: download - view: text, markup, annotated - select for diffs
Sun Oct 22 06:07:28 2006 UTC (20 years ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +6 -2 lines
sync with head

Revision 1.36: download - view: text, markup, annotated - select for diffs
Fri Oct 6 03:20:47 2006 UTC (20 years, 1 month ago) by mrg
Branches: MAIN
CVS tags: yamt-splraiseipl-base2, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, 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
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +3 -3 lines
add a missing semicolon from the previous commit.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Thu Oct 5 17:35:19 2006 UTC (20 years, 1 month ago) by tls
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +6 -2 lines
Protect calls to pool_put/pool_get that may occur in interrupt context
with spl used to protect other allocations and frees, or datastructure
element insertion and removal, in adjacent code.

It is almost unquestionably the case that some of the spl()/splx() calls
added here are superfluous, but it really seems wrong to see:

	s=splfoo();
	/* frob data structure */
	splx(s);
	pool_put(x);

and if we think we need to protect the first operation, then it is hard
to see why we should not think we need to protect the next.  "Better
safe than sorry".

It is also almost unquestionably the case that I missed some pool
gets/puts from interrupt context with my strategy for finding these
calls; use of PR_NOWAIT is a strong hint that a pool may be used from
interrupt context but many callers in the kernel pass a "can wait/can't
wait" flag down such that my searches might not have found them.  One
notable area that needs to be looked at is pf.

See also:

http://mail-index.netbsd.org/tech-kern/2006/07/19/0003.html
http://mail-index.netbsd.org/tech-kern/2006/07/19/0009.html

Revision 1.32.4.1: download - view: text, markup, annotated - select for diffs
Sat Sep 9 02:58:47 2006 UTC (20 years, 2 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32: +5 -3 lines
sync with head

Revision 1.32.8.2: download - view: text, markup, annotated - select for diffs
Sun Sep 3 15:25:42 2006 UTC (20 years, 2 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.32.8.1: preferred, colored; branchpoint 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32.8.1: +4 -2 lines
sync with head.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sat Sep 2 12:41:01 2006 UTC (20 years, 2 months ago) by liamjfoy
Branches: MAIN
CVS tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +4 -2 lines
increment ips_total too.

ok matt thomas

Revision 1.32.8.1: download - view: text, markup, annotated - select for diffs
Mon Jun 26 12:53:57 2006 UTC (20 years, 4 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +3 -3 lines
sync with head.

Revision 1.29.6.1: download - view: text, markup, annotated - select for diffs
Wed Jun 21 15:11:01 2006 UTC (20 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +6 -11 lines
sync with head.

Revision 1.32.14.1: download - view: text, markup, annotated - select for diffs
Mon Jun 19 04:09:48 2006 UTC (20 years, 5 months ago) by chap
Branches: chap-midi
Diff to: previous 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32: +3 -3 lines
Sync with head.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Wed Jun 7 22:34:01 2006 UTC (20 years, 5 months ago) by kardel
Branches: MAIN
CVS tags: yamt-pdpolicy-base7, yamt-pdpolicy-base6, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +3 -3 lines
merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html

Revision 1.32.6.1: download - view: text, markup, annotated - select for diffs
Sat Feb 4 14:18:52 2006 UTC (20 years, 9 months ago) by simonb
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.32: preferred, colored; next MAIN 1.33: preferred, colored
Changes since revision 1.32: +3 -3 lines
Adapt for timecounters: mostly use get*time(), use bintime's for timeout
calculations and use "time_second" instead of "time.tv_sec".

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sat Dec 24 23:43:17 2005 UTC (20 years, 10 months ago) by perry
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5, yamt-uio_vmspace, yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, simonb-timecounters-base, peter-altq-base, peter-altq, elad-kernelauth-base, elad-kernelauth
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, chap-midi
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +3 -3 lines
change comment from __const__ to const

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:24:57 2005 UTC (20 years, 11 months ago) by christos
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -2 lines
merge ktrace-lwp.

Revision 1.26.6.5: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:11:07 2005 UTC (21 years ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.26.6.4: preferred, colored; branchpoint 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26.6.4: +4 -9 lines
Sync with HEAD. Here we go again...

Revision 1.30: download - view: text, markup, annotated - select for diffs
Mon Oct 17 19:51:24 2005 UTC (21 years, 1 month ago) by christos
Branches: 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, ktrace-lwp-base
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +4 -9 lines
small list macro cleanup:
- remove duplicate LIST_FIRST (Liam Foy)
- change to use LIST_FOREACH or for () instead of while () for consistency

Revision 1.28.4.1: download - view: text, markup, annotated - select for diffs
Fri Apr 29 11:29:33 2005 UTC (21 years, 6 months ago) by kent
Branches: kent-audio2
Diff to: previous 1.28: preferred, colored; next MAIN 1.29: preferred, colored
Changes since revision 1.28: +12 -24 lines
sync with -current

Revision 1.28.6.1: download - view: text, markup, annotated - select for diffs
Sat Feb 12 18:17:54 2005 UTC (21 years, 9 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.28: preferred, colored; next MAIN 1.29: preferred, colored
Changes since revision 1.28: +12 -24 lines
sync with head.

Revision 1.26.6.4: download - view: text, markup, annotated - select for diffs
Fri Feb 4 11:47:48 2005 UTC (21 years, 9 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.26.6.3: preferred, colored; branchpoint 1.26: preferred, colored
Changes since revision 1.26.6.3: +12 -24 lines
Sync with HEAD.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Thu Feb 3 22:43:34 2005 UTC (21 years, 9 months ago) by perry
Branches: MAIN
CVS tags: yamt-km-base4, yamt-km-base3, yamt-km-base2, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, kent-audio2-base
Branch point for: yamt-lazymbuf
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +12 -24 lines
KNF + slightly ANSIfy

Revision 1.26.6.3: download - view: text, markup, annotated - select for diffs
Tue Sep 21 13:37:12 2004 UTC (22 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.26.6.2: preferred, colored; branchpoint 1.26: preferred, colored
Changes since revision 1.26.6.2: +2 -2 lines
Fix the sync with head I botched.

Revision 1.26.6.2: download - view: text, markup, annotated - select for diffs
Sat Sep 18 14:54:54 2004 UTC (22 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.26.6.1: preferred, colored; branchpoint 1.26: preferred, colored
Changes since revision 1.26.6.1: +0 -0 lines
Sync with HEAD.

Revision 1.26.6.1: download - view: text, markup, annotated - select for diffs
Tue Aug 3 10:54:38 2004 UTC (22 years, 3 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +19 -6 lines
Sync with HEAD

Revision 1.28: download - view: text, markup, annotated - select for diffs
Sun Apr 25 16:42:42 2004 UTC (22 years, 6 months ago) by simonb
Branches: MAIN
CVS tags: yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1, BEFORE-IPF413
Branch point for: yamt-km, kent-audio2
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +3 -6 lines
Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Fri Dec 12 21:17:59 2003 UTC (22 years, 11 months ago) by scw
Branches: MAIN
CVS tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2, BEFORE-IPF411
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +18 -2 lines
Make fast-ipsec and ipflow (Fast Forwarding) interoperate.

The idea is that we only clear M_CANFASTFWD if an SPD exists
for the packet. Otherwise, it's safe to add a fast-forward
cache entry for the route.

To make this work properly, we invalidate the entire ipflow
cache if a fast-ipsec key is added or changed.

Revision 1.16.2.7: download - view: text, markup, annotated - select for diffs
Mon Nov 11 22:15:22 2002 UTC (24 years ago) by nathanw
Branches: nathanw_sa
CVS tags: nathanw_sa_end
Diff to: previous 1.16.2.6: preferred, colored; next MAIN 1.17: preferred, colored
Changes since revision 1.16.2.6: +2 -2 lines
Catch up to -current

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sat Nov 2 07:28:12 2002 UTC (24 years ago) by perry
Branches: MAIN
CVS tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Branch point for: ktrace-lwp
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +4 -4 lines
/*CONTCOND*/ while (0)'ed macros

Revision 1.19.2.4: download - view: text, markup, annotated - select for diffs
Fri Sep 6 08:49:11 2002 UTC (24 years, 2 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.19.2.3: preferred, colored; branchpoint 1.19: preferred, colored; next MAIN 1.20: preferred, colored
Changes since revision 1.19.2.3: +15 -4 lines
sync kqueue branch with HEAD

Revision 1.16.2.6: download - view: text, markup, annotated - select for diffs
Thu Aug 1 02:46:47 2002 UTC (24 years, 3 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.16.2.5: preferred, colored
Changes since revision 1.16.2.5: +15 -4 lines
Catch up to -current.

Revision 1.23.6.2: download - view: text, markup, annotated - select for diffs
Mon Jul 15 10:36:57 2002 UTC (24 years, 4 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.23.6.1: preferred, colored; branchpoint 1.23: preferred, colored; next MAIN 1.24: preferred, colored
Changes since revision 1.23.6.1: +15 -4 lines
catch up with -current.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sun Jun 30 22:40:34 2002 UTC (24 years, 4 months ago) by thorpej
Branches: MAIN
CVS tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gehenna-devsw-base
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +15 -4 lines
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.19.2.3: download - view: text, markup, annotated - select for diffs
Sun Jun 23 17:50:49 2002 UTC (24 years, 4 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.19.2.2: preferred, colored; branchpoint 1.19: preferred, colored
Changes since revision 1.19.2.2: +5 -5 lines
catch up with -current on kqueue branch

Revision 1.23.6.1: download - view: text, markup, annotated - select for diffs
Thu Jun 20 15:52:19 2002 UTC (24 years, 5 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +5 -5 lines
catch up with -current.

Revision 1.16.2.5: download - view: text, markup, annotated - select for diffs
Thu Jun 20 03:48:41 2002 UTC (24 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.16.2.4: preferred, colored
Changes since revision 1.16.2.4: +5 -5 lines
Catch up to -current.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sun Jun 9 16:33:40 2002 UTC (24 years, 5 months ago) by itojun
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +5 -5 lines
whitespace

Revision 1.16.2.4: download - view: text, markup, annotated - select for diffs
Mon Apr 1 07:48:34 2002 UTC (24 years, 7 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.16.2.3: preferred, colored
Changes since revision 1.16.2.3: +2 -2 lines
Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.19.2.2: download - view: text, markup, annotated - select for diffs
Sat Mar 16 16:02:12 2002 UTC (24 years, 8 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.19.2.1: preferred, colored; branchpoint 1.19: preferred, colored
Changes since revision 1.19.2.1: +3 -3 lines
Catch up with -current.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Fri Mar 8 20:48:43 2002 UTC (24 years, 8 months ago) by thorpej
Branches: MAIN
CVS tags: newlock-base, newlock, netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, eeh-devprop-base, eeh-devprop
Branch point for: gehenna-devsw
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +3 -3 lines
Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.

Revision 1.19.2.1: download - view: text, markup, annotated - select for diffs
Thu Jan 10 20:02:47 2002 UTC (24 years, 10 months ago) by thorpej
Branches: kqueue
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +5 -6 lines
Sync kqueue branch with -current.

Revision 1.16.2.3: download - view: text, markup, annotated - select for diffs
Wed Nov 14 19:17:47 2001 UTC (25 years ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.16.2.2: preferred, colored
Changes since revision 1.16.2.2: +4 -5 lines
Catch up to -current.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Tue Nov 13 00:32:37 2001 UTC (25 years ago) by lukem
Branches: MAIN
CVS tags: ifpoll-base
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +4 -1 lines
add RCSIDs

Revision 1.20.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 12 21:19:23 2001 UTC (25 years ago) by thorpej
Branches: thorpej-mips-cache
Diff to: previous 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20: +1 -5 lines
Sync the thorpej-mips-cache branch with -current.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Mon Oct 29 07:02:33 2001 UTC (25 years ago) by simonb
Branches: MAIN
CVS tags: thorpej-mips-cache-base
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +1 -5 lines
Don't need to include <uvm/uvm_extern.h> just to include <sys/sysctl.h>
anymore.

Revision 1.19.4.1: download - view: text, markup, annotated - select for diffs
Mon Oct 1 12:47:42 2001 UTC (25 years, 1 month ago) by fvdl
Branches: thorpej-devvp
Diff to: previous 1.19: preferred, colored; next MAIN 1.20: preferred, colored
Changes since revision 1.19: +2 -2 lines
Catch up with -current.

Revision 1.16.2.2: download - view: text, markup, annotated - select for diffs
Fri Sep 21 22:36:48 2001 UTC (25 years, 2 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.16.2.1: preferred, colored
Changes since revision 1.16.2.1: +2 -2 lines
Catch up to -current.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Mon Sep 17 17:27:00 2001 UTC (25 years, 2 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej-devvp-base3, thorpej-devvp-base2
Branch point for: thorpej-mips-cache
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +2 -2 lines
Split the pre-computed ifnet checksum flags into Tx and Rx directions.
Add capabilities bits that indicate an interface can only perform
in-bound TCPv4 or UDPv4 checksums.  There is at least one Gig-E chip
for which this is true (Level One LXT-1001), and this is also the
case for the Intel i82559 10/100 Ethernet chips.

Revision 1.16.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 21 20:08:35 2001 UTC (25 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +31 -9 lines
Catch up to -current.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Tue Jun 12 15:17:28 2001 UTC (25 years, 5 months ago) by wiz
Branches: MAIN
CVS tags: thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp, kqueue
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +2 -2 lines
receive, not recieve

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sat Jun 2 16:17:09 2001 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +26 -4 lines
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.14.2.2: download - view: text, markup, annotated - select for diffs
Sat Apr 21 17:46:48 2001 UTC (25 years, 7 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.14.2.1: preferred, colored; branchpoint 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14.2.1: +5 -5 lines
Sync with HEAD

Revision 1.17: download - view: text, markup, annotated - select for diffs
Fri Apr 13 23:30:22 2001 UTC (25 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +5 -5 lines
Remove the use of splimp() from the NetBSD kernel.  splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.

Revision 1.14.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 20 18:10:26 2000 UTC (26 years ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +11 -4 lines
Update thorpej_scsipi to -current as of a month ago

Revision 1.13.2.2: download - view: text, markup, annotated - select for diffs
Sat Jul 1 17:42:48 2000 UTC (26 years, 4 months ago) by he
Branches: netbsd-1-4
CVS tags: netbsd-1-4-PATCH003
Diff to: previous 1.13.2.1: preferred, colored; branchpoint 1.13: preferred, colored; next MAIN 1.14: preferred, colored
Changes since revision 1.13.2.1: +9 -3 lines
Pull up revision 1.16 (requested by thorpej):
  Pass the correct destination address for the route-to-gateway
  case.  Fixes PR#10483.

Revision 1.14.10.1: download - view: text, markup, annotated - select for diffs
Fri Jun 30 19:46:32 2000 UTC (26 years, 4 months ago) by thorpej
Branches: netbsd-1-5
CVS tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2
Diff to: previous 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14: +9 -3 lines
Pull up rev. 1.16:
Pass the correct destination address for the route-to-gateway case.
>From Zdenek Salvet, kern/10483.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Fri Jun 30 19:43:53 2000 UTC (26 years, 4 months ago) by thorpej
Branches: MAIN
Branch point for: nathanw_sa
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +9 -3 lines
Pass the correct destination address for the route-to-gateway case.
From Zdenek Salvet, kern/10483.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Jun 28 03:01:16 2000 UTC (26 years, 4 months ago) by mrg
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +3 -2 lines
<vm/vm.h> -> <uvm/uvm_extern.h>

Revision 1.13.8.1: download - view: text, markup, annotated - select for diffs
Mon Dec 27 18:36:15 1999 UTC (26 years, 10 months ago) by wrstuden
Branches: wrstuden-devbsize
Diff to: previous 1.13: preferred, colored; next MAIN 1.14: preferred, colored
Changes since revision 1.13: +9 -1 lines
Pull up to last week's -current.

Revision 1.13.2.1: download - view: text, markup, annotated - select for diffs
Mon Oct 18 00:00:05 1999 UTC (27 years, 1 month ago) by cgd
Branches: netbsd-1-4
CVS tags: netbsd-1-4-PATCH002
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +9 -1 lines
pull up rev 1.14 from trunk (requested by sommerfeld):
  Multicast storm prevention: don't attempt to forward link-level
  multicast packets which contain ip unicast packets; these packets
  would only be generated from misconfigured/buggy systems.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Oct 17 23:38:45 1999 UTC (27 years, 1 month ago) by sommerfeld
Branches: MAIN
CVS tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, netbsd-1-5-base, minoura-xpg4dl-base, minoura-xpg4dl, fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999, chs-ubc2-newbase
Branch point for: thorpej_scsipi, netbsd-1-5
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +9 -1 lines
If a packet came in as link-level broadcast or link-level multicast, don't
attempt to fast-forward it out.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Fri Mar 26 08:51:35 1999 UTC (27 years, 7 months ago) by proff
Branches: MAIN
CVS tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH001, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame, chs-ubc2-base, chs-ubc2
Branch point for: wrstuden-devbsize, netbsd-1-4
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +2 -2 lines
security: test for ip_len < ip_hl <<2 and drop packet accordingly

Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Jan 28 21:29:27 1999 UTC (27 years, 9 months ago) by itohy
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +2 -2 lines
~htons(...) is always negative.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Jan 25 15:53:29 1999 UTC (27 years, 9 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +2 -2 lines
One more tweak to the checksum hack, and I promise I'm done.  B-)

Revision 1.10: download - view: text, markup, annotated - select for diffs
Mon Jan 25 15:36:50 1999 UTC (27 years, 9 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -2 lines
Absolutely minor tweak to generate better code.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sun Jan 24 13:34:35 1999 UTC (27 years, 9 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +5 -6 lines
Update the comment about the checksum hack.  It was way out of date.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Jan 24 12:57:38 1999 UTC (27 years, 9 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -4 lines
Modify the checksum slightly so that the htons()s can all be combined.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Thu Oct 8 01:41:45 1998 UTC (28 years, 1 month ago) by thorpej
Branches: MAIN
CVS tags: kenh-if-detach-base, kenh-if-detach, chs-ubc-base, chs-ubc
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +20 -5 lines
Use the pool allocator for ipflow entries.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Wed Jun 10 00:47:57 1998 UTC (28 years, 5 months ago) by sommerfe
Branches: MAIN
CVS tags: eeh-paddr_t-base, eeh-paddr_t
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +15 -2 lines
Truncate mbufs to the correct length before forwarding; fixes pr5560

Revision 1.5: download - view: text, markup, annotated - select for diffs
Tue Jun 2 15:48:03 1998 UTC (28 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +67 -59 lines
In addition to the IP flow hash table, put the flows on a list.  The table
is used for fast lookup, the list for traversal of all flows.  Also, use
PRT timers.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon May 18 17:08:56 1998 UTC (28 years, 6 months ago) by matt
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +3 -3 lines
Fix two bugs.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon May 4 19:24:53 1998 UTC (28 years, 6 months ago) by matt
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +56 -50 lines
Default IP flow to being enabled.  Add a sysctl to control the maximum
number of flows (net.inet.ip.maxflows).  If set to 0, will disable fast
path forwarding.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon May 4 05:46:04 1998 UTC (28 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +18 -12 lines
- kern/5380 (Dennis Ferguson): fix incremental IP header checksum.
- kern/5381 (Dennis Ferguson): check IP header checksum in fast forward
  code.
- In ipflow_slowtimo(), if no IP flows are in use, don't bother checking
  all of the hash buckets.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Wed Apr 29 21:37:55 1998 UTC (28 years, 6 months ago) by matt
Branches: MAIN
Add support for "fast" forwarding.  Add hooks in if_ethersubr.c and
if_fddisubr.c to fastpath IP forwarding.  If ip_forward successfully
forwards a packet, it will create a cache (ipflow) entry.  ether_input
and fddi_input will first call ipflow_fastforward with the received
packet and if the packet passes enough tests, it will be forwarded (the
ttl is decremented and the cksum is adjusted incrementally).

Diff request

This form allows you to request diffs 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.

Log view options

CVSweb <webmaster@jp.NetBSD.org>