The NetBSD Project

CVS log for src/sys/net/if.h

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.305.2.1.2.5 / (download) - annotate - [select for diffs], Thu Nov 16 05:13:13 2023 UTC (3 months, 2 weeks ago) by thorpej
Branch: thorpej-ifq
Changes since 1.305.2.1.2.4: +1 -3 lines
Diff to previous 1.305.2.1.2.4 (colored) to branchpoint 1.305.2.1 (colored)

if_transmit_lock() and if_enqueue() are equivalent.  if_enqueue() is
a better name, so collapse everything down to that and garbage-collect
if_transmit_lock().

Revision 1.305.2.1.2.4 / (download) - annotate - [select for diffs], Thu Nov 16 04:30:22 2023 UTC (3 months, 2 weeks ago) by thorpej
Branch: thorpej-ifq
Changes since 1.305.2.1.2.3: +1 -18 lines
Diff to previous 1.305.2.1.2.3 (colored) to branchpoint 1.305.2.1 (colored)

IFQ_CLASSIFY() -> ifq_classify_packet().

Revision 1.305.2.1.2.3 / (download) - annotate - [select for diffs], Wed Nov 15 02:19:00 2023 UTC (3 months, 2 weeks ago) by thorpej
Branch: thorpej-ifq
Changes since 1.305.2.1.2.2: +6 -1 lines
Diff to previous 1.305.2.1.2.2 (colored) to branchpoint 1.305.2.1 (colored)

Protect the ALTQ state that's exposed to the ifqueue if the ifq->ifq_lock.
This requires exposing some implementation details to ALTQ, which is guarded
by an __IFQ_PRIVATE define.

Revision 1.305.2.1.2.2 / (download) - annotate - [select for diffs], Wed Nov 15 02:08:34 2023 UTC (3 months, 2 weeks ago) by thorpej
Branch: thorpej-ifq
Changes since 1.305.2.1.2.1: +3 -3 lines
Diff to previous 1.305.2.1.2.1 (colored) to branchpoint 1.305.2.1 (colored)

Rename ifq_enqueue() -> if_enqueue(), ifq_enqueue2() -> if_enqueue2().

Revision 1.305.2.1.2.1 / (download) - annotate - [select for diffs], Tue Nov 14 14:47:03 2023 UTC (3 months, 2 weeks ago) by thorpej
Branch: thorpej-ifq
Changes since 1.305.2.1: +112 -2 lines
Diff to previous 1.305.2.1 (colored)

New network interface output queue API.

Revision 1.305.2.1 / (download) - annotate - [select for diffs], Sat Nov 11 13:16:30 2023 UTC (3 months, 3 weeks ago) by thorpej
Branch: thorpej-altq-separation
CVS Tags: thorpej-ifq-base
Branch point for: thorpej-ifq
Changes since 1.305: +13 -14 lines
Diff to previous 1.305 (colored)

Mostly de-tangle ifnet::if_snd from ifaltq, in a way that's minimally-
invasive to the ALTQ code itself.

The point of this is to lay the groundwork for future changes to ifqueue,
which among other benefits, will also hide the ALTQ ABI from drivers.

Revision 1.305 / (download) - annotate - [select for diffs], Mon Oct 9 11:55:34 2023 UTC (4 months, 3 weeks ago) by riastradh
Branch: MAIN
CVS Tags: triaxx-drm, thorpej-altq-separation-base, HEAD
Branch point for: thorpej-altq-separation
Changes since 1.304: +10 -2 lines
Diff to previous 1.304 (colored)

net/if.h: Explain the IFF_ALLMULTI situation.

No functional change intended.

Revision 1.304 / (download) - annotate - [select for diffs], Fri Nov 25 08:39:32 2022 UTC (15 months, 1 week ago) by knakahara
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.303: +10 -2 lines
Diff to previous 1.303 (colored)

Support explicit unnumbered interface.

Currently, NetBSD supports implicit unnumbered interface by setting
the same IP address to two interfaces.  However, such interface is not
treated as unnumbered when one of the interfaces is being changed and
has been changed IP address.  That behavior can be harmful for some
routing daemons.

Revision 1.303 / (download) - annotate - [select for diffs], Mon Oct 24 08:11:25 2022 UTC (16 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.302: +2 -2 lines
Diff to previous 1.302 (colored)

Make ifq_drops in struct ifqueue and struct ifaltq 64 bit.

Revision 1.302 / (download) - annotate - [select for diffs], Sun Sep 18 16:58:54 2022 UTC (17 months, 2 weeks ago) by martin
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.301: +2 -2 lines
Diff to previous 1.301 (colored)

Typo in comment

Revision 1.301 / (download) - annotate - [select for diffs], Sat Sep 3 02:47:59 2022 UTC (18 months ago) by thorpej
Branch: MAIN
Changes since 1.300: +1 -15 lines
Diff to previous 1.300 (colored)

Garbage-collect the remaining vestiges of netisr.

Revision 1.300 / (download) - annotate - [select for diffs], Sat Aug 20 11:09:24 2022 UTC (18 months, 2 weeks ago) by riastradh
Branch: MAIN
Changes since 1.299: +2 -2 lines
Diff to previous 1.299 (colored)

ifnet(9): Defer if_watchdog (a.k.a. if_slowtimo) to workqueue.

This is necessary to make mii_down and the *_init/stop routines that
call it to sleep waiting for MII callouts on other CPUs.

Mark the workqueue and callout MP-safe; only take the kernel lock
around the callback.

No kernel bump despite change to struct ifnet because the change is
ABI-compatible and using the callout outside net/if.c has never been
kosher.

Revision 1.299 / (download) - annotate - [select for diffs], Thu Jul 28 15:15:29 2022 UTC (19 months, 1 week ago) by skrll
Branch: MAIN
Changes since 1.298: +4 -4 lines
Diff to previous 1.298 (colored)

Trailing whitespace

Revision 1.298 / (download) - annotate - [select for diffs], Mon Jun 20 08:20:09 2022 UTC (20 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.297: +3 -1 lines
Diff to previous 1.297 (colored)

 bpf(4): added support for VLAN hardware offloading of ethernet devices

Revision 1.297 / (download) - annotate - [select for diffs], Mon Jun 20 08:02:25 2022 UTC (20 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.296: +3 -2 lines
Diff to previous 1.296 (colored)

Handling frames that vlan id is 0 as non-VLAN frames
even if a vlan tag is stripped by harware offloading

Revision 1.296 / (download) - annotate - [select for diffs], Fri Dec 31 14:24:26 2021 UTC (2 years, 2 months ago) by riastradh
Branch: MAIN
Changes since 1.295: +5 -1 lines
Diff to previous 1.295 (colored)

sys/net: New functions if_ioctl, if_init, and if_stop.

These are wrappers, suitable for inserting appropriate kasserts
regarding the API's locking contract, for the corresponding functions
in struct ifnet.

Since these are intended to commit configuration changes to the
interface, which may involve resetting the device, the caller should
hold IFNET_LOCK.  However, I can't straightforwardly prove that all
callers do yet, so the assertion is disabled for now.

Revision 1.295 / (download) - annotate - [select for diffs], Thu Sep 30 03:51:05 2021 UTC (2 years, 5 months ago) by yamaguchi
Branch: MAIN
Changes since 1.294: +1 -2 lines
Diff to previous 1.294 (colored)

net: obsolete ifnet::if_link_state_chenged
that was used for updating link-state of vlan I/F

The obsoleted function is replaced with
ifnet::if_linkstate_hooks

Revision 1.294 / (download) - annotate - [select for diffs], Thu Sep 30 03:23:48 2021 UTC (2 years, 5 months ago) by yamaguchi
Branch: MAIN
Changes since 1.293: +8 -1 lines
Diff to previous 1.293 (colored)

Provide a hook point called at change of link state

Revision 1.293 / (download) - annotate - [select for diffs], Thu Sep 30 03:15:25 2021 UTC (2 years, 5 months ago) by yamaguchi
Branch: MAIN
Changes since 1.292: +2 -3 lines
Diff to previous 1.292 (colored)

Replace ifnet::if_agriprivate with ifnet::if_lagg

agr(4) and lagg(4) can not be used on the same interface so that
if_agrprivate and if_lagg are not used at the same time.
For resolve this wasteful, if_lagg is used in not only lagg(4)
but also agr(4).

After this modification, if_lagg has 3 states:
1. if_lagg == NULL
   - Both agr(4) and lagg(4) are not running on the interface
2. if_lagg != NULL && ifp->if_type != IFT_IEEE8023ADLAG
   - agr(4) is running on the I/F
3. if_lagg != NULL && ifp->if_type == IFT_IEEE8023ADLAG
   - lagg(4) is running on the I/F

Revision 1.292 / (download) - annotate - [select for diffs], Mon Aug 9 20:49:10 2021 UTC (2 years, 6 months ago) by andvar
Branch: MAIN
Changes since 1.291: +2 -2 lines
Diff to previous 1.291 (colored)

fix various typos in compatibility, mainly in comments.

Revision 1.289.6.2 / (download) - annotate - [select for diffs], Sun Aug 1 22:42:41 2021 UTC (2 years, 7 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.289.6.1: +3 -3 lines
Diff to previous 1.289.6.1 (colored) to branchpoint 1.289 (colored) next main 1.290 (colored)

Sync with HEAD.

Revision 1.291 / (download) - annotate - [select for diffs], Tue Jun 29 21:19:58 2021 UTC (2 years, 8 months ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2
Changes since 1.290: +3 -3 lines
Diff to previous 1.290 (colored)

Make if_stats_init, if_attach, if_initialize return void.

percpu_alloc can't fail.


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>

Revision 1.289.6.1 / (download) - annotate - [select for diffs], Thu Jun 17 04:46:35 2021 UTC (2 years, 8 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.289: +2 -1 lines
Diff to previous 1.289 (colored)

Sync w/ HEAD.

Revision 1.289.8.1 / (download) - annotate - [select for diffs], Mon May 31 22:15:21 2021 UTC (2 years, 9 months ago) by cjep
Branch: cjep_staticlib_x
Changes since 1.289: +2 -1 lines
Diff to previous 1.289 (colored) next main 1.290 (colored)

sync with head

Revision 1.290 / (download) - annotate - [select for diffs], Mon May 17 04:07:43 2021 UTC (2 years, 9 months ago) by yamaguchi
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Changes since 1.289: +2 -1 lines
Diff to previous 1.289 (colored)

Add a new link-aggregation pseudo interface named lagg(4)

 - FreeBSD's lagg(4) based implementation
 - MP-safe and MP-scalable

Revision 1.289 / (download) - annotate - [select for diffs], Thu Oct 15 10:20:44 2020 UTC (3 years, 4 months ago) by roy
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs, cjep_staticlib_x-base
Branch point for: thorpej-i2c-spi-conf, cjep_staticlib_x
Changes since 1.288: +1 -9 lines
Diff to previous 1.288 (colored)

net: remove IFEF_NO_LINK_STATE_CHANGE

This flag was only set for virtual interfaces.
All virtual interfaces have a means of knowing if they are going to work
or not and as such now support link state changes.

If we want this flag back, it should be used as an indicator that
the interfaces does not support link state changes that userland can use
so it can make a decision on what to do when the link state is UNKNOWN.

Revision 1.288 / (download) - annotate - [select for diffs], Sun Sep 27 19:16:28 2020 UTC (3 years, 5 months ago) by roy
Branch: MAIN
Changes since 1.287: +2 -1 lines
Diff to previous 1.287 (colored)

bridge: When an interface joins then mark addresses on it as tentative

The exact flow is detatch addresses, join bridge and then mark detached
addresses as tentative.
This ensures that Duplicate Address Detection for the joining interface
are performed across all members of the bridge.

Revision 1.287 / (download) - annotate - [select for diffs], Sat Sep 26 18:35:12 2020 UTC (3 years, 5 months ago) by roy
Branch: MAIN
Changes since 1.286: +2 -1 lines
Diff to previous 1.286 (colored)

net: Add a callback to ifnet to notify of link state changes

Revision 1.286 / (download) - annotate - [select for diffs], Sat Sep 26 11:57:05 2020 UTC (3 years, 5 months ago) by roy
Branch: MAIN
Changes since 1.285: +1 -3 lines
Diff to previous 1.285 (colored)

net: Fix the setting of if_link_state

Link state changes are not dependant on the interface being up, but we also
need to guard against more link state changes being scheduled when the
interface is being detached.

We do this by clearing the link queue but keeping if_link_sheduled = true.
We can check for this in both if_link_state_change() and
if_link_state_change_work() to abort early as there is no point in doing
anything if the interface is being detached because if_down() is called
in if_detach() after the workqueue has been drained to the same overall
effect.

Revision 1.285 / (download) - annotate - [select for diffs], Tue Sep 22 14:14:17 2020 UTC (3 years, 5 months ago) by roy
Branch: MAIN
Changes since 1.284: +26 -1 lines
Diff to previous 1.284 (colored)

ifconfig: Report link state even if media is not supported

For AF_LINK addrs from getifaddrs(2), ifa_data is struct if_data.
This in turn holds ifi_link_state which we can use to report
link status if the interface does not support media where it's normally
reported.

Based on OpenBSD.

Revision 1.284 / (download) - annotate - [select for diffs], Fri Aug 28 06:23:42 2020 UTC (3 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.283: +15 -1 lines
Diff to previous 1.283 (colored)

net: introduce IFQ_ENQUEUE_ISR to assemble packet queuing routines (NFCI)

Revision 1.283 / (download) - annotate - [select for diffs], Tue May 5 08:05:03 2020 UTC (3 years, 10 months ago) by jdolecek
Branch: MAIN
Changes since 1.282: +1 -4 lines
Diff to previous 1.282 (colored)

remove struct ifnet if_mcastop, it's not used by anything

Revision 1.263.2.3 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:15 2020 UTC (3 years, 10 months ago) by martin
Branch: phil-wifi
Changes since 1.263.2.2: +37 -3 lines
Diff to previous 1.263.2.2 (colored) to branchpoint 1.263 (colored) next main 1.264 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.263.2.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:57 2020 UTC (3 years, 10 months ago) by martin
Branch: phil-wifi
Changes since 1.263.2.1: +26 -23 lines
Diff to previous 1.263.2.1 (colored) to branchpoint 1.263 (colored)

Merge changes from current as of 20200406

Revision 1.277.2.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:06 2020 UTC (4 years ago) by ad
Branch: ad-namecache
Changes since 1.277: +26 -23 lines
Diff to previous 1.277 (colored) next main 1.278 (colored)

Sync with head.

Revision 1.282 / (download) - annotate - [select for diffs], Fri Feb 14 22:04:12 2020 UTC (4 years ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3
Changes since 1.281: +1 -32 lines
Diff to previous 1.281 (colored)

Remove the conditional __IF_STATS_PERCPU.

Revision 1.281 / (download) - annotate - [select for diffs], Thu Feb 6 23:30:19 2020 UTC (4 years ago) by thorpej
Branch: MAIN
Changes since 1.280: +7 -3 lines
Diff to previous 1.280 (colored)

Perform link state change processing on a work queue, rather than in a
softint.

Revision 1.280 / (download) - annotate - [select for diffs], Sat Feb 1 21:59:39 2020 UTC (4 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.279: +5 -1 lines
Diff to previous 1.279 (colored)

Make if_stats competely opaque to user-space.

Revision 1.279 / (download) - annotate - [select for diffs], Sat Feb 1 21:11:10 2020 UTC (4 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.278: +7 -1 lines
Diff to previous 1.278 (colored)

Flip the switch to the per-cpu implementation in <net/if_stats.h>.  Leave
the conditional in place for a time in case serious problems are discovered,
so that the Old Way can be re-enabled quickly.  After some time, the Old
Way will be removed completely.

Revision 1.278 / (download) - annotate - [select for diffs], Wed Jan 29 03:16:28 2020 UTC (4 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.277: +22 -2 lines
Diff to previous 1.277 (colored)

Add support for MP-safe network interface statistics by maintaining them
in per-cpu storage, and collecting them for export in an if_data structure
when user-space wants them.

The new if_stat API is structured to make a gradual transition to the
new way in network drivers possible, and per-cpu stats are currently
disabled (thus there is no kernel ABI change).  Once all drivers have
been converted, the old ABI will be removed, and per-cpu stats will be
enabled universally.

Revision 1.239.2.8 / (download) - annotate - [select for diffs], Tue Sep 24 18:27:09 2019 UTC (4 years, 5 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE
Changes since 1.239.2.7: +28 -1 lines
Diff to previous 1.239.2.7 (colored) to branchpoint 1.239 (colored) next main 1.240 (colored)

Pull up following revision(s) (requested by knakahara in ticket #1385):

	sys/net/if.c				1.461
	sys/net/if.h				1.277
	sys/net/if_gif.c			1.149
	sys/net/if_gif.h			1.33
	sys/net/if_ipsec.c			1.19,1.20,1.24
	sys/net/if_ipsec.h			1.5
	sys/net/if_l2tp.c			1.33,1.36-1.39
	sys/net/if_l2tp.h			1.7,1.8
	sys/net/route.c				1.220,1.221
	sys/net/route.h				1.125
	sys/netinet/in_gif.c			1.95
	sys/netinet/in_l2tp.c			1.17
	sys/netinet/ip_input.c			1.391,1.392
	sys/netinet/wqinput.c			1.6
	sys/netinet6/in6_gif.c			1.94
	sys/netinet6/in6_l2tp.c			1.18
	sys/netinet6/ip6_forward.c		1.97
	sys/netinet6/ip6_input.c		1.210,1.211
	sys/netipsec/ipsec_output.c		1.82,1.83 (patched)
	sys/netipsec/ipsecif.c			1.12,1.13,1.15,1.17 (patched)
	sys/netipsec/key.c			1.259,1.260

ipsecif(4) support input drop packet counter.

ipsecif(4) should not increment drop counter by errors not related to if_snd. Pointed out by ozaki-r@n.o, thanks.
Remove unnecessary addresses in PF_KEY message.

MOBIKE Extensions for PF_KEY draft-schilcher-mobike-pfkey-extension-01.txt says
====================
5.  SPD Update
// snip
   SADB_X_SPDADD:
// snip
      sadb_x_ipsecrequest_reqid:
         An ID for that SA can be passed to the kernel in the
         sadb_x_ipsecrequest_reqid field.
      If tunnel mode is specified, the sadb_x_ipsecrequest structure is
      followed by two sockaddr structures that define the tunnel
      endpoint addresses.  In the case that transport mode is used, no
      additional addresses are specified.
====================
see: <a  rel="nofollow" href="https://tools.ietf.org/html/draft-schilcher-mobike-pfkey-extension-01">https://tools.ietf.org/html/draft-schilcher-mobike-pfkey-extension-01</a>

ipsecif(4) uses transport mode, so it should not add addresses.

ipsecif(4) supports multiple peers in the same NAPT.

E.g. ipsec0 connects between NetBSD_A and NetBSD_B, ipsec1 connects
NetBSD_A and NetBSD_C at the following figure.
                                        +----------+
                                   +----| NetBSD_B |
 +----------+           +------+   |    +----------+
 | NetBSD_A |--- ... ---| NAPT |---+
 +----------+           +------+   |    +----------+
                                   +----| NetBSD_C |
                                        +----------+

Add ATF later.

l2tp(4): fix output bytes counter. Pointed by k-goda@IIJ, thanks.
remove a variable which is no longer used.

l2tp: initialize mowner variables for MBUFTRACE

Avoid having a rtcache directly in a percpu storage
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.
A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by knakahara@ and yamaguchi@


wqinput: avoid having struct wqinput_worklist directly in a percpu storage
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Input handlers of wqinput normally involves sleepable operations so we must
avoid dereferencing a percpu data (struct wqinput_worklist) after executing
an input handler.  Address this situation by having just a pointer to the data
in a percpu storage instead.

Reviewed by knakahara@ and yamaguchi@

Add missing #include <sys/kmem.h>

Divide Tx context of l2tp(4) to improve performance.
It seems l2tp(4) call path is too long for instruction cache. So, dividing
l2tp(4) Tx context improves CPU use efficiency.

After this commit, l2tp(4) throughput gains 10% on my machine(Atom C3000).

Apply some missing changes lost on the previous commit

Avoid having a rtcache directly in a percpu storage for tunnel protocols.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.
A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

l2tp(4): avoid having struct ifqueue directly in a percpu storage.

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Tx processing of l2tp(4) uses normally involves sleepable operations so we
must avoid dereferencing a percpu data (struct ifqueue) after executing Tx
processing.  Address this situation by having just a pointer to the data in
a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

Revision 1.274.2.1 / (download) - annotate - [select for diffs], Tue Sep 24 03:10:35 2019 UTC (4 years, 5 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.274: +28 -1 lines
Diff to previous 1.274 (colored) next main 1.275 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #238):

	sys/netipsec/ipsec_output.c: revision 1.83
	sys/net/route.h: revision 1.125
	sys/netinet6/ip6_input.c: revision 1.210
	sys/netinet6/ip6_input.c: revision 1.211
	sys/net/if.c: revision 1.461
	sys/net/if_gif.h: revision 1.33
	sys/net/route.c: revision 1.220
	sys/net/route.c: revision 1.221
	sys/net/if.h: revision 1.277
	sys/netinet6/ip6_forward.c: revision 1.97
	sys/netinet/wqinput.c: revision 1.6
	sys/net/if_ipsec.h: revision 1.5
	sys/netinet6/in6_l2tp.c: revision 1.18
	sys/netinet6/in6_gif.c: revision 1.94
	sys/net/if_l2tp.h: revision 1.7
	sys/net/if_gif.c: revision 1.149
	sys/net/if_l2tp.h: revision 1.8
	sys/netinet/in_gif.c: revision 1.95
	sys/netinet/in_l2tp.c: revision 1.17
	sys/netipsec/ipsecif.c: revision 1.17
	sys/net/if_ipsec.c: revision 1.24
	sys/net/if_l2tp.c: revision 1.37
	sys/netinet/ip_input.c: revision 1.391
	sys/net/if_l2tp.c: revision 1.38
	sys/netinet/ip_input.c: revision 1.392
	sys/net/if_l2tp.c: revision 1.39

Avoid having a rtcache directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

wqinput: avoid having struct wqinput_worklist directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Input handlers of wqinput normally involves sleepable operations so we must
avoid dereferencing a percpu data (struct wqinput_worklist) after executing
an input handler.  Address this situation by having just a pointer to the data
in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

Add missing #include <sys/kmem.h>

 -

Divide Tx context of l2tp(4) to improve performance.

It seems l2tp(4) call path is too long for instruction cache. So, dividing
l2tp(4) Tx context improves CPU use efficiency.

After this commit, l2tp(4) throughput gains 10% on my machine(Atom C3000).

 -

Apply some missing changes lost on the previous commit

 -

Avoid having a rtcache directly in a percpu storage for tunnel protocols.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

 -

l2tp(4): avoid having struct ifqueue directly in a percpu storage.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Tx processing of l2tp(4) uses normally involves sleepable operations so we
must avoid dereferencing a percpu data (struct ifqueue) after executing Tx
processing.  Address this situation by having just a pointer to the data in
a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

Revision 1.277 / (download) - annotate - [select for diffs], Thu Sep 19 06:07:24 2019 UTC (4 years, 5 months ago) by knakahara
Branch: MAIN
CVS Tags: phil-wifi-20191119, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.276: +28 -1 lines
Diff to previous 1.276 (colored)

Avoid having a rtcache directly in a percpu storage for tunnel protocols.

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.
A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

Revision 1.276 / (download) - annotate - [select for diffs], Fri Sep 13 07:55:07 2019 UTC (4 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.275: +3 -3 lines
Diff to previous 1.275 (colored)

 if_flags is neither int nor short. It's unsigned short.

Revision 1.275 / (download) - annotate - [select for diffs], Sat Aug 10 21:13:54 2019 UTC (4 years, 6 months ago) by rmind
Branch: MAIN
Changes since 1.274: +2 -1 lines
Diff to previous 1.274 (colored)

Add the ifnet_t::if_npf_private field.  Bump the kernel version.
Fixes PR/54098.

Revision 1.274 / (download) - annotate - [select for diffs], Thu Jul 4 02:44:25 2019 UTC (4 years, 8 months ago) by ozaki-r
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.273: +7 -1 lines
Diff to previous 1.273 (colored)

Add support for a network interface description.

ioctl(2):
- Add SIOCGIFDESCR/SIOCSIFDESCR commands to get/set the description.

This enables to make a memo for interface, like "Home network" or "Remote VPN".

From t-kusaba@IIJ

Revision 1.273 / (download) - annotate - [select for diffs], Mon Jun 24 06:24:33 2019 UTC (4 years, 8 months ago) by skrll
Branch: MAIN
Changes since 1.272: +2 -2 lines
Diff to previous 1.272 (colored)

Fix 'unknown' spellos

Revision 1.263.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:45 2019 UTC (4 years, 8 months ago) by christos
Branch: phil-wifi
Changes since 1.263: +46 -51 lines
Diff to previous 1.263 (colored)

Sync with HEAD

Revision 1.272 / (download) - annotate - [select for diffs], Fri May 10 06:53:42 2019 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20190609
Changes since 1.271: +21 -21 lines
Diff to previous 1.271 (colored)

 Remove extra parentheses. No functional change.

Revision 1.271 / (download) - annotate - [select for diffs], Fri May 10 06:45:19 2019 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.270: +5 -5 lines
Diff to previous 1.270 (colored)

 Add missing parentheses for IFQ_CLASSIFY macro's argument.

Revision 1.270 / (download) - annotate - [select for diffs], Fri May 10 05:16:34 2019 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.269: +9 -9 lines
Diff to previous 1.269 (colored)

 Modify comment to make the data structure clear. No functional change.

Revision 1.269 / (download) - annotate - [select for diffs], Sat Mar 23 09:48:04 2019 UTC (4 years, 11 months ago) by pgoyette
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.268: +7 -1 lines
Diff to previous 1.268 (colored)

Replace compile-time checking for vlan code with a module hook.

Should resolve the errors reported on irc when booting a kernel which
has agr without vlan:


 [   1.0000000] WARNING: module error: built-in module if_agr can't find builtin dependency `if_vlan'
 [   1.0000000] WARNING: module error: built-in module if_agr prerequisite if_vlan failed, error 2

Revision 1.268 / (download) - annotate - [select for diffs], Tue Feb 5 06:43:20 2019 UTC (5 years ago) by msaitoh
Branch: MAIN
Changes since 1.267: +2 -2 lines
Diff to previous 1.267 (colored)

 Remove NOTRAILERS from IFFBITS.

Revision 1.267 / (download) - annotate - [select for diffs], Tue Feb 5 06:17:03 2019 UTC (5 years ago) by msaitoh
Branch: MAIN
Changes since 1.266: +2 -2 lines
Diff to previous 1.266 (colored)

 Remove very old IFF_NOTRAILERS flag.

Revision 1.258.2.15 / (download) - annotate - [select for diffs], Sat Oct 20 06:58:45 2018 UTC (5 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.258.2.14: +2 -1 lines
Diff to previous 1.258.2.14 (colored) to branchpoint 1.258 (colored) next main 1.259 (colored)

Sync with head

Revision 1.266 / (download) - annotate - [select for diffs], Thu Oct 18 11:34:54 2018 UTC (5 years, 4 months ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020
Changes since 1.265: +2 -1 lines
Diff to previous 1.265 (colored)

fix panic when do ifconfig -vlanif and ifconfig vlanif again. advised by ozaki-r@.

e.g. do the following commands.
    ====================
    # ifconfig vlan0 create
    # ifconfig vlan0 vlan 100 vlanif wm0
    # ifconfig vlan0 -vlanif wm0
    # ifconfig vlan0 vlan 100 vlanif wm0
    ====================

ATF net/if_vlan do this type of test, however it cannot detect this bug.
Because the shmif(4)'s ifp->if_hwdl is always NULL as shmif(4)'s ethernet
address is set U/L bit.
See: https://nxr.netbsd.org/xref/src/sys/net/if_ethersubr.c#997

Revision 1.258.2.14 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:44 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.13: +5 -19 lines
Diff to previous 1.258.2.13 (colored) to branchpoint 1.258 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

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

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

Revision 1.258.2.13 / (download) - annotate - [select for diffs], Sat Jul 28 04:38:09 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.12: +2 -1 lines
Diff to previous 1.258.2.12 (colored) to branchpoint 1.258 (colored)

Sync with HEAD

Revision 1.239.2.7 / (download) - annotate - [select for diffs], Fri Jul 13 15:49:55 2018 UTC (5 years, 7 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE
Changes since 1.239.2.6: +2 -1 lines
Diff to previous 1.239.2.6 (colored) to branchpoint 1.239 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #911):

	sys/kern/init_main.c: revision 1.498
	sys/rump/net/lib/libnet/net_component.c: revision 1.10
	sys/net/if.h: revision 1.264
	sys/net/if.c: revision 1.429

Fix net.inet6.ip6.ifq node doesn't exist

The node (and child nodes) is initialized in sysctl_net_pktq_setup, but the call
of sysctl_net_pktq_setup is skipped unexpectedly.
sysctl_net_pktq_setup is skipped if in6_present is false that indicates the
netinet6 component isn't loaded on rump kernels.  However the flag is
accidentally always false because the flag is turned on in in6_dom_init that is
called after if_sysctl_setup on both normal and rump kernels.

Fix the issue by moving if_sysctl_setup after in6_dom_init (domaininit on normal
kernels).  This fix is ad-hoc but good enough for netbsd-8.  We should refine
the initialization order of network components in the future.

Pointed out by hikaru@

Revision 1.239.2.6 / (download) - annotate - [select for diffs], Fri Jul 13 14:26:48 2018 UTC (5 years, 7 months ago) by martin
Branch: netbsd-8
Changes since 1.239.2.5: +9 -1 lines
Diff to previous 1.239.2.5 (colored) to branchpoint 1.239 (colored)

Pull up following revision(s) via patch (requested by knakahara in ticket #905):

	sys/netinet/ip_mroute.c: revision 1.160
	sys/netinet6/in6_l2tp.c: revision 1.16
	sys/net/if.h: revision 1.263
	sys/netinet/in_l2tp.c: revision 1.15
	sys/netinet/ip_icmp.c: revision 1.172
	sys/netinet/igmp.c: revision 1.68
	sys/netinet/ip_encap.c: revision 1.69
	sys/netinet6/ip6_mroute.c: revision 1.129

sbappendaddr() is required any lock. Currently, softnet_lock is appropriate.

When rip_input() is called as inetsw[].pr_input, rip_iput() is always called
with holding softnet_lock, that is, in case of !defined(NET_MPSAFE) it is
acquired in ipintr(), otherwise(defined(NET_MPSAFE)) it is acquire in
PR_WRAP_INPUT macro.

However, some function calls rip_input() directly without holding softnet_lock.
That causes assertion failure in sbappendaddr().
rip6_input() and icmp6_rip6_input() are also required softnet_lock for the same
reason.

Revision 1.264 / (download) - annotate - [select for diffs], Tue Jul 3 03:37:03 2018 UTC (5 years, 8 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.263: +2 -1 lines
Diff to previous 1.263 (colored)

Fix net.inet6.ip6.ifq node doesn't exist

The node (and child nodes) is initialized in sysctl_net_pktq_setup, but the call
of sysctl_net_pktq_setup is skipped unexpectedly.

sysctl_net_pktq_setup is skipped if in6_present is false that indicates the
netinet6 component isn't loaded on rump kernels.  However the flag is
accidentally always false because the flag is turned on in in6_dom_init that is
called after if_sysctl_setup on both normal and rump kernels.

Fix the issue by moving if_sysctl_setup after in6_dom_init (domaininit on normal
kernels).  This fix is ad-hoc but good enough for netbsd-8.  We should refine
the initialization order of network components in the future.

Pointed out by hikaru@

Revision 1.258.2.12 / (download) - annotate - [select for diffs], Mon Jun 25 07:26:06 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.11: +12 -1 lines
Diff to previous 1.258.2.11 (colored) to branchpoint 1.258 (colored)

Sync with HEAD

Revision 1.263 / (download) - annotate - [select for diffs], Thu Jun 21 10:37:49 2018 UTC (5 years, 8 months ago) by knakahara
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.262: +9 -1 lines
Diff to previous 1.262 (colored)

sbappendaddr() is required any lock. Currently, softnet_lock is appropriate.

When rip_input() is called as inetsw[].pr_input, rip_iput() is always called
with holding softnet_lock, that is, in case of !defined(NET_MPSAFE) it is
acquired in ipintr(), otherwise(defined(NET_MPSAFE)) it is acquire in
PR_WRAP_INPUT macro.
However, some function calls rip_input() directly without holding softnet_lock.
That causes assertion failure in sbappendaddr().
rip6_input() and icmp6_rip6_input() are also required softnet_lock for the same
reason.

Revision 1.262 / (download) - annotate - [select for diffs], Tue Jun 12 07:12:35 2018 UTC (5 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.261: +4 -1 lines
Diff to previous 1.261 (colored)

Check if ether_ifdetach is called without INET_LOCK

Revision 1.258.2.11 / (download) - annotate - [select for diffs], Wed May 2 07:20:22 2018 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.10: +2 -1 lines
Diff to previous 1.258.2.10 (colored) to branchpoint 1.258 (colored)

Synch with HEAD

Revision 1.261 / (download) - annotate - [select for diffs], Tue May 1 06:50:06 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0521, pgoyette-compat-0502
Changes since 1.260: +2 -1 lines
Diff to previous 1.260 (colored)

Move if_name() from net_osdep.h to if.h. net_osdep.h is now unused and can
be removed - the other BSDs did the same.

Discussed with Kengo (if.h suggested by him).

Revision 1.258.2.10 / (download) - annotate - [select for diffs], Sun Apr 22 07:20:27 2018 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.9: +7 -7 lines
Diff to previous 1.258.2.9 (colored) to branchpoint 1.258 (colored)

Sync with HEAD

Revision 1.260 / (download) - annotate - [select for diffs], Thu Apr 19 21:20:43 2018 UTC (5 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-0422
Changes since 1.259: +7 -7 lines
Diff to previous 1.259 (colored)

s/static inline/static __inline/g for consistency.

Revision 1.258.2.9 / (download) - annotate - [select for diffs], Mon Apr 16 02:00:08 2018 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.8: +1 -3 lines
Diff to previous 1.258.2.8 (colored) to branchpoint 1.258 (colored)

Sync with HEAD, resolve some conflicts

Revision 1.239.2.5 / (download) - annotate - [select for diffs], Sat Apr 14 10:16:19 2018 UTC (5 years, 10 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.239.2.4: +1 -3 lines
Diff to previous 1.239.2.4 (colored) to branchpoint 1.239 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #749):

	sys/net/if.h: revision 1.259
	sys/net/route.c: revision 1.209
	sys/net/route.h: revision 1.118
	sys/net/rtsock.c: revision 1.240

Resolve tangled lock dependencies in route.c

This change sweeps remaining lock decisions based on if locked or not by
moving utility functions of rtentry updates from rtsock.c and ensuring
holding the rt_lock.
It also improves the atomicity of a update of a rtentry.

Revision 1.259 / (download) - annotate - [select for diffs], Thu Apr 12 04:38:13 2018 UTC (5 years, 10 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-compat-0415
Changes since 1.258: +1 -3 lines
Diff to previous 1.258 (colored)

Resolve tangled lock dependencies in route.c

This change sweeps remaining lock decisions based on if locked or not by moving
utility functions of rtentry updates from rtsock.c and ensuring holding the
rt_lock.  It also improves the atomicity of a update of a rtentry.

Revision 1.258.2.8 / (download) - annotate - [select for diffs], Thu Mar 8 00:25:30 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.7: +1 -9 lines
Diff to previous 1.258.2.7 (colored) to branchpoint 1.258 (colored)

Handle ifconf() compat vectors

Revision 1.258.2.7 / (download) - annotate - [select for diffs], Tue Mar 6 23:49:45 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.6: +2 -2 lines
Diff to previous 1.258.2.6 (colored) to branchpoint 1.258 (colored)

Declare it correctly

Revision 1.258.2.6 / (download) - annotate - [select for diffs], Tue Mar 6 23:48:34 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.5: +2 -2 lines
Diff to previous 1.258.2.5 (colored) to branchpoint 1.258 (colored)

Declare the compat_ifconf vector, not the stub.

Revision 1.258.2.5 / (download) - annotate - [select for diffs], Tue Mar 6 23:39:35 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.4: +4 -1 lines
Diff to previous 1.258.2.4 (colored) to branchpoint 1.258 (colored)

And we need the oifreq definition here, too

Revision 1.258.2.4 / (download) - annotate - [select for diffs], Tue Mar 6 23:31:29 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.3: +1 -4 lines
Diff to previous 1.258.2.3 (colored) to branchpoint 1.258 (colored)

Better to add these required headers closer to where they're needed

Revision 1.258.2.3 / (download) - annotate - [select for diffs], Tue Mar 6 23:27:52 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.2: +2 -1 lines
Diff to previous 1.258.2.2 (colored) to branchpoint 1.258 (colored)

And another required header

Revision 1.258.2.2 / (download) - annotate - [select for diffs], Tue Mar 6 23:24:11 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258.2.1: +3 -1 lines
Diff to previous 1.258.2.1 (colored) to branchpoint 1.258 (colored)

Include necessary header

Revision 1.258.2.1 / (download) - annotate - [select for diffs], Tue Mar 6 23:19:20 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.258: +7 -1 lines
Diff to previous 1.258 (colored)

Move indirect function call vectors to if.h where they can be
found by the code that manipulates them.

Revision 1.239.2.4 / (download) - annotate - [select for diffs], Sun Feb 11 21:17:34 2018 UTC (6 years ago) by snj
Branch: netbsd-8
Changes since 1.239.2.3: +3 -1 lines
Diff to previous 1.239.2.3 (colored) to branchpoint 1.239 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #536):
	distrib/sets/lists/base/shl.mi: 1.825
	distrib/sets/lists/comp/mi: 1.2168-1.2169
	distrib/sets/lists/comp/shl.mi: 1.310
	distrib/sets/lists/debug/mi: 1.234
	distrib/sets/lists/debug/shl.mi: 1.188
	distrib/sets/lists/man/mi: 1.1570
	distrib/sets/lists/tests/mi: 1.772
	etc/mtree/NetBSD.dist.tests: 1.150
	share/man/man4/Makefile: 1.650
	share/man/man4/ipsec.4: 1.42-1.43
	share/man/man4/ipsecif.4: 1.1-1.5
	sys/arch/amd64/conf/ALL: 1.77
	sys/arch/amd64/conf/GENERIC: 1.480
	sys/conf/files: 1.1191
	sys/net/Makefile: 1.34
	sys/net/files.net: 1.14
	sys/net/if.c: 1.404
	sys/net/if.h: 1.248
	sys/net/if_gif.c: 1.135
	sys/net/if_ipsec.c: 1.1-1.3
	sys/net/if_ipsec.h: 1.1
	sys/net/if_l2tp.c: 1.16
	sys/net/if_types.h: 1.28
	sys/netinet/in.c: 1.214
	sys/netinet/in.h: 1.103
	sys/netinet/in_gif.c: 1.92
	sys/netinet/ip_var.h: 1.122
	sys/netinet6/in6.c: 1.257
	sys/netinet6/in6.h: 1.88
	sys/netinet6/in6_gif.c: 1.90
	sys/netinet6/ip6_var.h: 1.75
	sys/netipsec/Makefile: 1.6
	sys/netipsec/files.netipsec: 1.13
	sys/netipsec/ipsec.h: 1.62
	sys/netipsec/ipsecif.c: 1.1
	sys/netipsec/ipsecif.h: 1.1
	sys/netipsec/key.c: 1.246-1.247
	sys/netipsec/key.h: 1.34
	sys/rump/net/Makefile.rumpnetcomp: 1.20
	sys/rump/net/lib/libipsec/IPSEC.ioconf: 1.1
	sys/rump/net/lib/libipsec/Makefile: 1.1
	sys/rump/net/lib/libipsec/ipsec_component.c: 1.1
	tests/net/Makefile: 1.34
	tests/net/if_ipsec/Makefile: 1.1
	tests/net/if_ipsec/t_ipsec.sh: 1.1-1.2
Don't touch an SP without a reference to it
unify processing to check nesting count for some tunnel protocols.
add ipsec(4) interface, which is used for route-based VPN.
man and ATF are added later, please see man for details.
reviewed by christos@n.o, joerg@n.o and ozaki-r@n.o, thanks.
https://mail-index.netbsd.org/tech-net/2017/12/18/msg006557.html
ipsec(4) interface supports rump now.
add ipsec(4) interface ATF.
add ipsec(4) interface man as ipsecif.4.
add ipsec(4) interface to amd64/GENERIC and amd64/ALL configs.
apply in{,6}_tunnel_validate() to gif(4).
Spell IPsec that way. Simplify macro usage. Sort SEE ALSO. Bump
date for previous.
Improve wording and macro use.
Some parts are not clear to me, so someone with knowledge of ipsecif(4)
should improve this some more.
Improve ipsecif.4. Default port ipsec(4) NAT-T is tested now.
pointed out by wiz@n.o and suggested by ozaki-r@n.o, thanks.
Change the prefix of test names to ipsecif_ to distinguish from tests for ipsec(4)
New sentence, new line. Remove empty macro.
Fix PR kern/52920. Pointed out by David Binderman, thanks.
Improve wording, and put a new drawing, from me and Kengo Nakahara.
apply a little more #ifdef INET/INET6.  fixes !INET6 builds.

Revision 1.258 / (download) - annotate - [select for diffs], Mon Jan 15 13:05:40 2018 UTC (6 years, 1 month ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.257: +2 -1 lines
Diff to previous 1.257 (colored)

Add a KASSERT in IFQ_CLASSIFY, we really need to make sure the given
mbuf is the top of the chain.

Revision 1.239.2.3 / (download) - annotate - [select for diffs], Tue Jan 2 10:20:33 2018 UTC (6 years, 2 months ago) by snj
Branch: netbsd-8
Changes since 1.239.2.2: +214 -89 lines
Diff to previous 1.239.2.2 (colored) to branchpoint 1.239 (colored)

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.257 / (download) - annotate - [select for diffs], Mon Dec 18 08:24:29 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.256: +11 -1 lines
Diff to previous 1.256 (colored)

Note that IFNET_LOCK must not be held in softint

Revision 1.256 / (download) - annotate - [select for diffs], Fri Dec 15 04:07:20 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.255: +28 -6 lines
Diff to previous 1.255 (colored)

Write a guideline for converting an interface to IFEF_MPSAFE

Requested by skrll@

Revision 1.255 / (download) - annotate - [select for diffs], Fri Dec 15 04:06:42 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.254: +108 -72 lines
Diff to previous 1.254 (colored)

Describe which lock is used to protect each member variable of struct ifnet

Requested by skrll@

Revision 1.254 / (download) - annotate - [select for diffs], Fri Dec 15 04:03:46 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.253: +2 -1 lines
Diff to previous 1.253 (colored)

Ensure to call if_mcast_op with holding IFNET_LOCK

Note that CARP doesn't deal with IFNET_LOCK yet.

Revision 1.253 / (download) - annotate - [select for diffs], Mon Dec 11 03:29:20 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.252: +5 -1 lines
Diff to previous 1.252 (colored)

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

Revision 1.252 / (download) - annotate - [select for diffs], Mon Dec 11 03:25:45 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.251: +4 -4 lines
Diff to previous 1.251 (colored)

Rename IFNET_LOCK to IFNET_GLOBAL_LOCK

IFNET_LOCK will be used in another lock, if_ioctl_lock (might be renamed then).

Revision 1.239.2.2 / (download) - annotate - [select for diffs], Sun Dec 10 10:10:24 2017 UTC (6 years, 2 months ago) by snj
Branch: netbsd-8
Changes since 1.239.2.1: +4 -3 lines
Diff to previous 1.239.2.1 (colored) to branchpoint 1.239 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #427):
	sys/arch/amiga/dev/if_bah_zbus.c: 1.17
	sys/arch/arm/broadcom/bcm53xx_eth.c: 1.30
	sys/arch/powerpc/booke/dev/pq3etsec.c: 1.32
	sys/arch/usermode/dev/if_veth.c: 1.9
	sys/dev/ic/an.c: 1.66
	sys/dev/ic/athn.c: 1.17
	sys/dev/ic/atw.c: 1.162
	sys/dev/ic/bwi.c: 1.33
	sys/dev/ic/dwc_gmac.c: 1.41-1.42
	sys/dev/ic/malo.c: 1.10
	sys/dev/ic/rt2560.c: 1.31
	sys/dev/ic/rt2661.c: 1.36
	sys/dev/ic/rt2860.c: 1.29
	sys/dev/ic/rtw.c: 1.127
	sys/dev/ic/rtwvar.h: 1.46
	sys/dev/ic/smc90cx6.c: 1.71
	sys/dev/ic/smc90cx6var.h: 1.12
	sys/dev/ic/wi.c: 1.244
	sys/dev/pci/if_ipw.c: 1.66
	sys/dev/pci/if_iwi.c: 1.104
	sys/dev/pci/if_iwm.c: 1.76
	sys/dev/pci/if_iwn.c: 1.86
	sys/dev/pci/if_rtwn.c: 1.13
	sys/dev/pci/if_wm.c: 1.541
	sys/dev/pci/if_wpi.c: 1.79
	sys/dev/pci/ixgbe/ixgbe.c: 1.106
	sys/dev/pci/ixgbe/ixv.c: 1.73 via patch
	sys/dev/pcmcia/if_malo_pcmcia.c: 1.15
	sys/dev/scsipi/if_se.c: 1.95
	sys/dev/usb/if_upl.c: 1.60
	sys/net/if.c: 1.396
	sys/net/if.h: 1.241
	sys/net/if_arc.h: 1.23
	sys/net/if_arcsubr.c: 1.78
	sys/net/if_bridge.c: 1.136-1.137
	sys/net/if_etherip.c: 1.39
	sys/net/if_faith.c: 1.56
	sys/net/if_gif.c: 1.131
	sys/net/if_loop.c: 1.96
	sys/net/if_mpls.c: 1.30
	sys/net/if_pppoe.c: 1.129
	sys/net/if_srt.c: 1.27
	sys/net/if_stf.c: 1.102
	sys/net/if_tap.c: 1.100
	sys/net/if_vlan.c: 1.105
	sys/netinet/ip_carp.c: 1.91
	sys/rump/net/lib/libshmif/if_shmem.c: 1.73-1.74
	sys/rump/net/lib/libvirtif/if_virt.c: 1.55-1.56
 if_initalize() and if_attach() failed when resource allocation failed
(e.g. allocating softint). Without this change, it panics. It's bad because
resource shortage really occured when a lot of pseudo interface is created.
To avoid this problem, don't panic and change return value of if_initialize()
and if_attach() to int. Caller fanction will be recover from error cleanly by
checking the return value.
 Return if bah_attach_subr() failed.
 If if_attach() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add some missing frees in bridge_clone_destroy().
- KNF
 If error occured in bcmeth_ccb_attach(), free resources and return.
 If error occured in pq3etsec_attach(), free resources and return.
 If error occured in the attach function, free resources and return.
- If if_initialize() failed in athn_attach(), free resources and return.
- Add missing pmf_event_deregister() in athn_detach().
- Free resources correctly on some errors in atw_attach().
- Use apint*() insread of printf() in the attach function.
 If if_initialize() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add missing dwc_gmac_free_dma_rings() and mutex_destroy() when attach
   failed.
- If if_initialize() failed in the attach function, free resources and return.
- ifp is always not NULL in iwi_detach(). Check correctly with ifp->if_softc.
- If if_initialize() failed in the attach function, free resources and return.
- Fix error path in the attach function correctly.
 If if_initialize() failed in the attach function, free resources and return.
 If if_attach() failed in the attach function, free resources and return.
 - If if_initialize() failed in the attach function, free resources and return.
 - KNF
 - If if_attach() failed in the attach function, free resources and return.
 - KNF
 Fix compile error.
 Fix compile error.
We don't need '&mii', but just 'mii' for mii_detach().
Don't free sc_rthash twice

Revision 1.251 / (download) - annotate - [select for diffs], Fri Dec 8 05:22:23 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.250: +1 -4 lines
Diff to previous 1.250 (colored)

Revert "Make if_timer MP-safe if IFEF_MPSAFE"

Because it has decreased the performance of wm. And also I found that
wm_watchdog doesn't work well with if_watchdog framework at all. Sharing one
counter (if_timer) with multiple instances (hardware multi-queues) can't detect
a single (or some) stall of them because other instances reset the counter even
if the stalled one want the watchdog to fire.

Interfaces without IFEF_MPSAFE works safely with the original if_watchdog thanks
to KENREL_LOCK. OTOH, interfaces with IFEF_MPSAFE shouldn't use if_watchdog and
should implement their own watchdog timer that works with multiple instances.

Revision 1.250 / (download) - annotate - [select for diffs], Fri Dec 8 04:03:51 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.249: +1 -3 lines
Diff to previous 1.249 (colored)

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

Revision 1.249 / (download) - annotate - [select for diffs], Wed Dec 6 09:03:12 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.248: +4 -1 lines
Diff to previous 1.248 (colored)

Make if_timer MP-safe if IFEF_MPSAFE

if_timer, a counter used by if_watchdog (if_slowtimo), can be modified in
if_watchdog and if_start and/or interrupt handlers of some device drivers. All
such accesses were serialized by KERNEL_LOCK. If IFEF_MPSAFE is enabled,
KERNEL_LOCK of if_start (and perhaps interrupt handlers) is omitted and if_timer
becomes racy.

Fix the race condition by protecting if_timer by a spin mutex. if_watchdog_reset
and if_watchdog_stop are introduced to ensure to take the mutex on accessing
if_timer. Interface with IFEF_MPSAFE enabled must use the functions.

In addition, if_watchdog callout is now set CALLOUT_MPSAFE if IFEF_MPSAFE. It
means that if_watchdog implemented by a driver must be MP-safe if the driver is
set IFEF_MPSAFE.

Currenlty interfaces with IFEF_MPSAFE implementing if_watchdog and accessing
if_timer in if_start and interrupt handlers are only wm(4). wm is changed to
use the functions. (Its watchdog handler (wm_watchdog) is already MP-safe.

These contracts will be written somewhere in a further commit.

Note that the spin mutex is now ifp->if_snd.ifq_lock to avoid adding another
spin mutex to each interface. For now reusing it isn't problematic (see the
comment to know why) thought if that does matter in the future, feel free to
replace it with a new spin mutex. It's easy to do.

Revision 1.248 / (download) - annotate - [select for diffs], Wed Dec 6 08:23:17 2017 UTC (6 years, 2 months ago) by knakahara
Branch: MAIN
Changes since 1.247: +3 -1 lines
Diff to previous 1.247 (colored)

unify processing to check nesting count for some tunnel protocols.

Revision 1.247 / (download) - annotate - [select for diffs], Wed Dec 6 08:12:54 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.246: +2 -1 lines
Diff to previous 1.246 (colored)

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.

Revision 1.246 / (download) - annotate - [select for diffs], Wed Dec 6 05:59:59 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.245: +2 -1 lines
Diff to previous 1.245 (colored)

Fix locking against myself on ifpromisc

vlan_unconfig_locked could be called with holding if_ioctl_lock.

Revision 1.245 / (download) - annotate - [select for diffs], Wed Dec 6 05:11:10 2017 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.244: +3 -1 lines
Diff to previous 1.244 (colored)

Ensure to hold if_ioctl_lock when calling if_flags_set

Revision 1.154.12.3 / (download) - annotate - [select for diffs], Sun Dec 3 11:39:02 2017 UTC (6 years, 3 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.154.12.2: +365 -135 lines
Diff to previous 1.154.12.2 (colored) to branchpoint 1.154 (colored) next main 1.155 (colored)

update from HEAD

Revision 1.244 / (download) - annotate - [select for diffs], Wed Nov 22 03:03:18 2017 UTC (6 years, 3 months ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.243: +14 -2 lines
Diff to previous 1.243 (colored)

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@

Revision 1.243 / (download) - annotate - [select for diffs], Fri Nov 17 07:37:12 2017 UTC (6 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.242: +41 -1 lines
Diff to previous 1.242 (colored)

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.242 / (download) - annotate - [select for diffs], Thu Nov 16 03:07:18 2017 UTC (6 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.241: +13 -15 lines
Diff to previous 1.241 (colored)

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@

Revision 1.241 / (download) - annotate - [select for diffs], Mon Oct 23 09:21:20 2017 UTC (6 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.240: +4 -3 lines
Diff to previous 1.240 (colored)

 if_initalize() and if_attach() failed when resource allocation failed
(e.g. allocating softint). Without this change, it panics. It's bad because
resource shortage really occured when a lot of pseudo interface is created.
To avoid this problem, don't panic and change return value of if_initialize()
and if_attach() to int. Caller fanction will be recover from error cleanly by
checking the return value.

Revision 1.181.2.12 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:11 2017 UTC (6 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.11: +8 -3 lines
Diff to previous 1.181.2.11 (colored) to branchpoint 1.181 (colored) next main 1.182 (colored)

Sync with HEAD

Revision 1.239.2.1 / (download) - annotate - [select for diffs], Sat Jul 1 08:56:06 2017 UTC (6 years, 8 months ago) by snj
Branch: netbsd-8
CVS Tags: matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.239: +2 -1 lines
Diff to previous 1.239 (colored)

Pull up following revision(s) (requested by roy in ticket #77):
	sys/net/if.h: revision 1.240
	sys/netinet/if_arp.c: revision 1.253
	sys/net/if.c: revision 1.395
Introduce if_get_bylla to find an interface with the active
local link address.
--
Use if_get_bylla() instead of just looking at the lla of the interface
the address belongs to.
This allows any ARP message we receieved from another interface to
be correctly dropped.
While here, move the protocol length check higher up the food chain.

Revision 1.240 / (download) - annotate - [select for diffs], Tue Jun 27 12:17:27 2017 UTC (6 years, 8 months ago) by roy
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825
Changes since 1.239: +2 -1 lines
Diff to previous 1.239 (colored)

Introduce if_get_bylla to find an interface with the active
local link address.

Revision 1.239 / (download) - annotate - [select for diffs], Fri May 19 08:53:51 2017 UTC (6 years, 9 months ago) by ozaki-r
Branch: MAIN
CVS Tags: netbsd-8-base
Branch point for: netbsd-8
Changes since 1.238: +2 -1 lines
Diff to previous 1.238 (colored)

Allow CARP to call the link_state_change handler immediately

If the handler is delayed because of the indirection call via softint,
some operations are executed in reverse and may cause unexpected
behaviors. For example, due to the issue a GARP packet wasn't sent on
a transition from the BACKUP state to the MASTER state; this happened
because IN_IFF_DETACHED flag wasn't cleared on arpannounce, which
had been cleared in the link_state_change handler.

This fixes an issue reported by sborrill@ on tech-net:
  http://mail-index.netbsd.org/tech-net/2017/03/14/msg006283.html

Revision 1.221.2.6 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:29 2017 UTC (6 years, 10 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.221.2.5: +1 -1 lines
Diff to previous 1.221.2.5 (colored) to branchpoint 1.221 (colored) next main 1.222 (colored)

Sync with HEAD

Revision 1.233.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:05 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.233: +6 -3 lines
Diff to previous 1.233 (colored) next main 1.234 (colored)

Sync with HEAD

Revision 1.238 / (download) - annotate - [select for diffs], Thu Apr 6 03:54:59 2017 UTC (6 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Changes since 1.237: +1 -2 lines
Diff to previous 1.237 (colored)

Revert "Make sure to hold if_ioctl_lock when calling ifp->if_ioctl"

As per pgoyette@ and riastradh@ requests; we shouldn't decide to
hold a lock based on if the lock is held or not.

Revision 1.237 / (download) - annotate - [select for diffs], Wed Apr 5 03:47:51 2017 UTC (6 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.236: +2 -1 lines
Diff to previous 1.236 (colored)

Make sure to hold if_ioctl_lock when calling ifp->if_ioctl

Unfortunately callers of ifp->if_ioctl (if_addr_init, if_flags_set
and if_mcast_op) may or may not hold if_ioctl_lock, so we have to
hold the lock only if it's not held.

Revision 1.221.2.5 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:49 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.221.2.4: +6 -3 lines
Diff to previous 1.221.2.4 (colored) to branchpoint 1.221 (colored)

Sync with HEAD

Revision 1.236 / (download) - annotate - [select for diffs], Tue Mar 14 09:03:08 2017 UTC (6 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320
Changes since 1.235: +2 -2 lines
Diff to previous 1.235 (colored)

Use if_acquire and if_release instead of using psref API directly

- Provide if_release for consistency to if_acquire
- Use if_acquire and if_release for ifp iterations
- Make ifnet_psref_class static

Revision 1.235 / (download) - annotate - [select for diffs], Thu Feb 23 07:57:10 2017 UTC (7 years ago) by ozaki-r
Branch: MAIN
Changes since 1.234: +4 -1 lines
Diff to previous 1.234 (colored)

Remove mkludge stuffs

For unknown reasons, IPv6 multicast addresses are linked to a first
IPv6 address assigned to an interface. Due to the design, when removing
a first address having multicast addresses, we need to save them to
somewhere and later restore them once a new IPv6 address is activated.
mkludge stuffs support the operations.

This change links multicast addresses to an interface directly and
throws the kludge away.

Note that as usual some obsolete member variables remain for kvm(3)
users. And also sysctl net.inet6.multicast_kludge remains to avoid
breaking old ifmcstat.

TODO: currently ifnet has a list of in6_multi but obviously the list
should be protocol independent. Provide a common structure (if_multi
or something) to handle in6_multi and in_multi together as well as
ifaddr does for in_ifaddr and in6_ifaddr.

Revision 1.234 / (download) - annotate - [select for diffs], Fri Feb 17 03:57:17 2017 UTC (7 years ago) by ozaki-r
Branch: MAIN
Changes since 1.233: +2 -2 lines
Diff to previous 1.233 (colored)

Rename if_acquire_NOMPSAFE to if_acquire

It can be used in MP-safe ways. So let's remove the confusing postfix.
If it's used in a unsafe way, warn NOMPSAFE in a comment.

Revision 1.181.2.11 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:58 2017 UTC (7 years ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.10: +9 -4 lines
Diff to previous 1.181.2.10 (colored) to branchpoint 1.181 (colored)

Sync with HEAD

Revision 1.221.2.4 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:50 2017 UTC (7 years, 1 month ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.221.2.3: +9 -5 lines
Diff to previous 1.221.2.3 (colored) to branchpoint 1.221 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.233 / (download) - annotate - [select for diffs], Thu Dec 22 03:46:51 2016 UTC (7 years, 2 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, nick-nhusb-base-20170204, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.232: +1 -3 lines
Diff to previous 1.232 (colored)

Remove assertion that the lock isn't held

It's useless in this case, because without it we can know that
the lock is held or not on a next lock acquisition and even more
if LOCKDEBUG is enabled a failure on the acquisition will provide
useful information for debugging while an assertion failure will
provide just the fact that the assertion failed.

Revision 1.232 / (download) - annotate - [select for diffs], Tue Dec 13 02:05:48 2016 UTC (7 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.231: +2 -2 lines
Diff to previous 1.231 (colored)

Constify ifp of if_is_deactivated

Revision 1.231 / (download) - annotate - [select for diffs], Mon Dec 12 03:55:57 2016 UTC (7 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.230: +3 -1 lines
Diff to previous 1.230 (colored)

Make the routing table and rtcaches MP-safe

See the following descriptions for details.

Proposed on tech-kern and tech-net


Overview
--------

We protect the routing table with a rwock and protect
rtcaches with another rwlock. Each rtentry is protected
from being freed or updated via reference counting and psref.

Global rwlocks
--------------

There are two rwlocks; one for the routing table (rt_lock) and
the other for rtcaches (rtcache_lock). rtcache_lock covers
all existing rtcaches; there may have room for optimizations
(future work).

The locking order is rtcache_lock first and rt_lock is next.

rtentry references
------------------

References to an rtentry is managed with reference counting
and psref. Either of the two mechanisms is used depending on
where a rtentry is obtained. Reference counting is used when
we obtain a rtentry from the routing table directly via
rtalloc1 and rtrequest{,1} while psref is used when we obtain
a rtentry from a rtcache via rtcache_* APIs. In both cases,
a caller can sleep/block with holding an obtained rtentry.

The reasons why we use two different mechanisms are (i) only
using reference counting hurts the performance due to atomic
instructions (rtcache case) (ii) ease of implementation;
applying psref to APIs such rtaloc1 and rtrequest{,1} requires
additional works (adding a local variable and an argument).

We will finally migrate to use only psref but we can do it
when we have a lockless routing table alternative.

Reference counting for rtentry
------------------------------

rt_refcnt now doesn't count permanent references such as for
rt_timers and rtcaches, instead it is used only for temporal
references when obtaining a rtentry via rtalloc1 and rtrequest{,1}.
We can do so because destroying a rtentry always involves
removing references of rt_timers and rtcaches to the rtentry
and we don't need to track such references. This also makes
it easy to wait for readers to release references on deleting
or updating a rtentry, i.e., we can simply wait until the
reference counter is 0 or 1. (If there are permanent references
the counter can be arbitrary.)

rt_ref increments a reference counter of a rtentry and rt_unref
decrements it. rt_ref is called inside APIs (rtalloc1 and
rtrequest{,1} so users don't need to care about it while
users must call rt_unref to an obtained rtentry after using it.

rtfree is removed and we use rt_unref and rt_free instead.
rt_unref now just decrements the counter of a given rtentry
and rt_free just tries to destroy a given rtentry.

See the next section for destructions of rtentries by rt_free.

Destructions of rtentries
-------------------------

We destroy a rtentry only when we call rtrequst{,1}(RTM_DELETE);
the original implementation can destroy in any rtfree where it's
the last reference. If we use reference counting or psref, it's
easy to understand if the place that a rtentry is destroyed is
fixed.

rt_free waits for references to a given rtentry to be released
before actually destroying the rtentry. rt_free uses a condition
variable (cv_wait) (and psref_target_destroy for psref) to wait.

Unfortunately rtrequst{,1}(RTM_DELETE) can be called in softint
that we cannot use cv_wait. In that case, we have to defer the
destruction to a workqueue.

rtentry#rt_cv, rtentry#rt_psref and global variables
(see rt_free_global) are added to conduct the procedure.

Updates of rtentries
--------------------

One difficulty to use refcnt/psref instead of rwlock for rtentry
is updates of rtentries. We need an additional mechanism to
prevent readers from seeing inconsistency of a rtentry being
updated.

We introduce RTF_UPDATING flag to rtentries that are updating.
While the flag is set to a rtentry, users cannot acquire the
rtentry. By doing so, we avoid users to see inconsistent
rtentries.

There are two options when a user tries to acquire a rtentry
with the RTF_UPDATING flag; if a user runs in softint context
the user fails to acquire a rtentry (NULL is returned).
Otherwise a user waits until the update completes by waiting
on cv.

The procedure of a updater is simpler to destruction of
a rtentry. Wait on cv (and psref) and after all readers left,
proceed with the update.

Global variables (see rt_update_global) are added to conduct
the procedure.

Currently we apply the mechanism to only RTM_CHANGE in
rtsock.c. We would have to apply other codes. See
"Known issues" section.

psref for rtentry
-----------------

When we obtain a rtentry from a rtcache via rtcache_* APIs,
psref is used to reference to the rtentry.

rtcache_ref acquires a reference to a rtentry with psref
and rtcache_unref releases the reference after using it.
rtcache_ref is called inside rtcache_* APIs and users don't
need to take care of it while users must call rtcache_unref
to release the reference.

struct psref and int bound that is needed for psref is
embedded into struct route. By doing so we don't need to
add local variables and additional argument to APIs.

However this adds another constraint to psref other than
reference counting one's; holding a reference of an rtentry
via a rtcache is allowed by just one caller at the same time.
So we must not acquire a rtentry via a rtcache twice and
avoid a recursive use of a rtcache. And also a rtcache must
be arranged to be used by a LWP/softint at the same time
somehow. For IP forwarding case, we have per-CPU rtcaches
used in softint so the constraint is guaranteed. For a h
rtcache of a PCB case, the constraint is guaranteed by the
solock of each PCB. Any other cases (pf, ipf, stf and ipsec)
are currently guaranteed by only the existence of the global
locks (softnet_lock and/or KERNEL_LOCK). If we've found the
cases that we cannot guarantee the constraint, we would need
to introduce other rtcache APIs that use simple reference
counting.

psref of rtcache is created with IPL_SOFTNET and so rtcache
shouldn't used at an IPL higher than IPL_SOFTNET.

Note that rtcache_free is used to invalidate a given rtcache.
We don't need another care by my change; just keep them as
they are.

Performance impact
------------------

When NET_MPSAFE is disabled the performance drop is 3% while
when it's enabled the drop is increased to 11%. The difference
comes from that currently we don't take any global locks and
don't use psref if NET_MPSAFE is disabled.

We can optimize the performance of the case of NET_MPSAFE
on by reducing lookups of rtcache that uses psref;
currently we do two lookups but we should be able to trim
one of two. This is a future work.

Known issues
------------

There are two known issues to be solved; one is that
a caller of rtrequest(RTM_ADD) may change rtentry (see rtinit).
We need to prevent new references during the update. Or
we may be able to remove the code (perhaps, need more
investigations).

The other is rtredirect that updates a rtentry. We need
to apply our update mechanism, however it's not easy because
rtredirect is called in softint and we cannot apply our
mechanism simply. One solution is to defer rtredirect to
a workqueue but it requires some code restructuring.

Revision 1.230 / (download) - annotate - [select for diffs], Thu Dec 8 01:06:35 2016 UTC (7 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.229: +6 -1 lines
Diff to previous 1.229 (colored)

Introduce deferred if_start framework

The framework provides a means to schedule if_start that will be executed
in softint later. It intends to be used to avoid calling if_start,
especially bpf_mtap, in hardware interrupt.

It adds a dedicated softint to a driver if the driver requests to use the
framework via if_deferred_start_init. The driver can schedule deferred
if_start by if_schedule_deferred_start.

Proposed and discussed on tech-kern and tech-net

Revision 1.181.2.10 / (download) - annotate - [select for diffs], Mon Dec 5 10:55:27 2016 UTC (7 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.9: +2 -3 lines
Diff to previous 1.181.2.9 (colored) to branchpoint 1.181 (colored)

Sync with HEAD

Revision 1.229 / (download) - annotate - [select for diffs], Tue Nov 22 02:06:00 2016 UTC (7 years, 3 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20161204
Changes since 1.228: +1 -2 lines
Diff to previous 1.228 (colored)

Make lortrequest static and rename it to loop_rtrequest

No functional change.

Revision 1.221.2.3 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:20 2016 UTC (7 years, 4 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.221.2.2: +11 -4 lines
Diff to previous 1.221.2.2 (colored) to branchpoint 1.221 (colored)

Sync with HEAD

Revision 1.228 / (download) - annotate - [select for diffs], Sat Oct 8 17:40:12 2016 UTC (7 years, 4 months ago) by joerg
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104
Changes since 1.227: +2 -2 lines
Diff to previous 1.227 (colored)

Since IFF_MULTICAST's value can't be represented without implicit cast
as signed short, make if_flags unsigned.

Revision 1.181.2.9 / (download) - annotate - [select for diffs], Wed Oct 5 20:56:08 2016 UTC (7 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.8: +44 -26 lines
Diff to previous 1.181.2.8 (colored) to branchpoint 1.181 (colored)

Sync with HEAD

Revision 1.227 / (download) - annotate - [select for diffs], Mon Oct 3 11:06:06 2016 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20161004
Changes since 1.226: +6 -1 lines
Diff to previous 1.226 (colored)

Fix race condition on ifqueue used by traditional netisr

If a underlying network device driver supports MSI/MSI-X, RX interrupts
can be delivered to arbitrary CPUs. This means that Layer 2 subroutines
such as ether_input (softint) and subsequent Layer 3 subroutines (softint)
which are called via traditional netisr can be dispatched on an arbitrary
CPU. Layer 2 subroutines now run without any locks (expected) and so a
Layer 2 subroutine and a Layer 3 subroutine can run in parallel.

There is a shared data between a Layer 2 routine and a Layer 3 routine,
that is ifqueue and IF_ENQUEUE (from L2) and IF_DEQUEUE (from L3) on it
are racy now.

To fix the race condition, use ifqueue#ifq_lock to protect ifqueue
instead of splnet that is meaningless now.

The same race condition exists in route_intr. Fix it as well.

Reviewed by knakahara@

Revision 1.226 / (download) - annotate - [select for diffs], Wed Sep 21 10:50:22 2016 UTC (7 years, 5 months ago) by roy
Branch: MAIN
Changes since 1.225: +5 -3 lines
Diff to previous 1.225 (colored)

Add ifam_pid and ifam_addrflags to ifa_msghdr.
Re-version RTM_NEWADDR, RTM_DELADDR, RTM_CHGADDR and NET_RT_IFLIST.
Add compat code for old version.

Revision 1.225 / (download) - annotate - [select for diffs], Wed Aug 10 10:09:42 2016 UTC (7 years, 6 months ago) by kre
Branch: MAIN
CVS Tags: localcount-20160914
Changes since 1.224: +2 -1 lines
Diff to previous 1.224 (colored)


On the first day (that being the eighth day of the eighth month,) the
building was completed only to discover that within there lay havoc.

On the second day all just groaned and moaned, and it must be someone
else's problen.

On the third day, St. Martin stepped in and traced the culprit, which
provided inspiration, and a correction was made.

Forevermore all were agog at just how such a trivial thing could do
so much damage...


OK...   to be a little less vague.   The loopback interface is a truly
"special" thing, and rump knew that - and treated it very specially.
Unfortunately, when the loopback interface is changed, and rump does
not keep up, bad things happen.

This (overall) might, or might not, be the correct fix - but for now
it appears to work.   If someone, sometime, finds a better way to
deal with the issues of the loopback interfaces true majesty, feel
free to revert this and do it another way.

Revision 1.221.2.2 / (download) - annotate - [select for diffs], Sat Aug 6 00:19:10 2016 UTC (7 years, 7 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.221.2.1: +19 -33 lines
Diff to previous 1.221.2.1 (colored) to branchpoint 1.221 (colored)

Sync with HEAD

Revision 1.224 / (download) - annotate - [select for diffs], Mon Aug 1 03:15:30 2016 UTC (7 years, 7 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20160806
Changes since 1.223: +16 -3 lines
Diff to previous 1.223 (colored)

Apply pserialize and psref to struct ifaddr and its variants

This change makes struct ifaddr and its variants (in_ifaddr and in6_ifaddr)
MP-safe by using pserialize and psref. At this moment, pserialize_perform
and psref_target_destroy are disabled because (1) we don't need them
because of softnet_lock (2) they cause a deadlock because of softnet_lock.
So we'll enable them when we remove softnet_lock in the future.

Revision 1.223 / (download) - annotate - [select for diffs], Mon Aug 1 02:50:03 2016 UTC (7 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.222: +4 -31 lines
Diff to previous 1.222 (colored)

Revert "Revert part of "Switch the address list of intefaces to pslist(9)" (r1.220)"

netstat now uses sysctl instead of kvm(3) to get address information from
the kernel. So we can avoid the issue introduced by the reverted commit
(PR kern/51325) by updating netstat with the latest source code.

Revision 1.221.2.1 / (download) - annotate - [select for diffs], Tue Jul 26 03:24:23 2016 UTC (7 years, 7 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.221: +19 -22 lines
Diff to previous 1.221 (colored)

Sync with HEAD

Revision 1.222 / (download) - annotate - [select for diffs], Fri Jul 22 07:09:40 2016 UTC (7 years, 7 months ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-localcount-20160726
Changes since 1.221: +19 -22 lines
Diff to previous 1.221 (colored)

Toward NET_MPSAFE-on in future, if_snd uses if_snd->ifq_lock by default.

That can reduce confusing difference between NET_MPSAFE on and off.

Revision 1.221 / (download) - annotate - [select for diffs], Mon Jul 11 02:14:27 2016 UTC (7 years, 7 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-base
Branch point for: pgoyette-localcount
Changes since 1.220: +31 -4 lines
Diff to previous 1.220 (colored)

Revert part of "Switch the address list of intefaces to pslist(9)" (r1.220)

Reverting the whole change set just messes up many files uselessly
because changes to them (except for if.h) are proper.

- Remove ifa_pslist_entry that breaks kvm(3) users (e.g., netstat -ia)
- Change IFADDR_{READER,WRITER}_* macros to use old IFADDR_* (or just NOP)
  for now

Fix PR kern/51325

Revision 1.181.2.8 / (download) - annotate - [select for diffs], Sat Jul 9 20:25:21 2016 UTC (7 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.7: +131 -11 lines
Diff to previous 1.181.2.7 (colored) to branchpoint 1.181 (colored)

Sync with HEAD

Revision 1.220 / (download) - annotate - [select for diffs], Thu Jul 7 09:32:02 2016 UTC (7 years, 7 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160907
Changes since 1.219: +51 -1 lines
Diff to previous 1.219 (colored)

Switch the address list of intefaces to pslist(9)

As usual, we leave the old list to avoid breaking kvm(3) users.

Revision 1.219 / (download) - annotate - [select for diffs], Thu Jun 30 09:44:58 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.218: +1 -2 lines
Diff to previous 1.218 (colored)

Get rid of duplicate prototype of ifafree

Revision 1.218 / (download) - annotate - [select for diffs], Tue Jun 28 02:36:54 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.217: +2 -1 lines
Diff to previous 1.217 (colored)

Introduce if_is_deactivated

Checking ifp->if_output == if_nulloutput is too implicit.

No functional change.

Revision 1.217 / (download) - annotate - [select for diffs], Mon Jun 27 10:09:02 2016 UTC (7 years, 8 months ago) by knakahara
Branch: MAIN
Changes since 1.216: +2 -2 lines
Diff to previous 1.216 (colored)

fix spelling mistake pointed out by roy@n.o

Revision 1.216 / (download) - annotate - [select for diffs], Mon Jun 27 08:58:50 2016 UTC (7 years, 8 months ago) by knakahara
Branch: MAIN
Changes since 1.215: +11 -3 lines
Diff to previous 1.215 (colored)

reduce link state changing softint if it is not required

ok by ozaki-r@n.o

Revision 1.215 / (download) - annotate - [select for diffs], Wed Jun 22 10:44:32 2016 UTC (7 years, 8 months ago) by knakahara
Branch: MAIN
Changes since 1.214: +2 -2 lines
Diff to previous 1.214 (colored)

fix: locking about IFQ_ENQUEUE and ALTQ

- If NET_MPSAFE is not defined, IFQ_LOCK is nop. Currently, that means
  IFQ_ENQUEUE() of some paths such as bridge_enqueue() is called parallel
  wrongly.
- If ALTQ is enabled, Tx processing should call if_transmit() (= IFQ_ENQUEUE
  + ifp->if_start()) instead of ifp->if_transmit() to call ALTQ_ENQUEUE()
  and ALTQ_DEQUEUE().
  Furthermore, ALTQ processing is always required KERNEL_LOCK currently.

Revision 1.214 / (download) - annotate - [select for diffs], Tue Jun 21 10:25:27 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.213: +2 -2 lines
Diff to previous 1.213 (colored)

Make sure returning ifp from in6_select* functions psref-ed

To this end, callers need to pass struct psref to the functions
and the fuctions acquire a reference of ifp with it. In some cases,
we can simply use if_get_byindex, however, in other cases
(say rt->rt_ifp and ia->ifa_ifp), we have no MP-safe way for now.
In order to take a reference anyway we use non MP-safe function
if_acquire_NOMPSAFE for the latter cases. They should be fixed in
the future somehow.

Revision 1.213 / (download) - annotate - [select for diffs], Tue Jun 21 03:28:27 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.212: +8 -1 lines
Diff to previous 1.212 (colored)

Replace ifp of ip_moptions and ip6_moptions with if_index

The motivation is the same as the mbuf's rcvif case; avoid having a pointer
of an ifnet object in ip_moptions and ip6_moptions, which is not MP-safe.

ip_moptions and ip6_moptions can be stored in a PCB for inet or inet6
that's life time is different from ifnet one and so an ifnet object can be
disappeared anytime we get it via them. Thus we need to look up an ifnet
object by if_index every time for safe.

Revision 1.212 / (download) - annotate - [select for diffs], Tue Jun 21 03:07:54 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.211: +4 -2 lines
Diff to previous 1.211 (colored)

Introduce if_index_t

Revision 1.211 / (download) - annotate - [select for diffs], Mon Jun 20 08:24:36 2016 UTC (7 years, 8 months ago) by knakahara
Branch: MAIN
Changes since 1.210: +21 -1 lines
Diff to previous 1.210 (colored)

introduce if_start_lock()

if_start_lock() calls ifp->if_start() holding KERNEL_LOCK if it is required.

Revision 1.210 / (download) - annotate - [select for diffs], Mon Jun 20 08:18:59 2016 UTC (7 years, 8 months ago) by knakahara
Branch: MAIN
Changes since 1.209: +3 -1 lines
Diff to previous 1.209 (colored)

fix: i386 build failure

Revision 1.209 / (download) - annotate - [select for diffs], Mon Jun 20 06:41:15 2016 UTC (7 years, 8 months ago) by knakahara
Branch: MAIN
Changes since 1.208: +25 -1 lines
Diff to previous 1.208 (colored)

introduce if_output_lock()

if_output_lock() calls ifp->if_output() holding KERNEL_LOCK if it is required.

Revision 1.208 / (download) - annotate - [select for diffs], Mon Jun 20 06:35:05 2016 UTC (7 years, 8 months ago) by knakahara
Branch: MAIN
Changes since 1.207: +6 -3 lines
Diff to previous 1.207 (colored)

introduce if_extflags (was if__pad1)

Revision 1.207 / (download) - annotate - [select for diffs], Fri Jun 10 13:31:44 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.206: +10 -6 lines
Diff to previous 1.206 (colored)

Avoid storing a pointer of an interface in a mbuf

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

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

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

Proposed on tech-kern and tech-net.

Revision 1.181.2.7 / (download) - annotate - [select for diffs], Sun May 29 08:44:38 2016 UTC (7 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.6: +66 -33 lines
Diff to previous 1.181.2.6 (colored) to branchpoint 1.181 (colored)

Sync with HEAD

Revision 1.206 / (download) - annotate - [select for diffs], Mon May 16 01:16:24 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529
Changes since 1.205: +2 -23 lines
Diff to previous 1.205 (colored)

Replace ifnet_lock with if_get and if_put

ifnet_lock is a dedicated method to safely destroy an interface over running
ioctl operations. Replace it with a more generic mechanism using psref(9).

Revision 1.205 / (download) - annotate - [select for diffs], Mon May 16 01:06:31 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.204: +5 -3 lines
Diff to previous 1.204 (colored)

Introduce if_get, if_get_byindex and if_put

The new API enables to obtain an ifnet object with protected by psref(9).
It is intended to be used where an obtained ifnet object is used over
sleepable operations.

Revision 1.204 / (download) - annotate - [select for diffs], Thu May 12 02:24:16 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.203: +53 -6 lines
Diff to previous 1.203 (colored)

Protect ifnet list with psz and psref

The change ensures that ifnet objects in the ifnet list aren't freed during
list iterations by using pserialize(9) and psref(9).

Note that the change adds a pslist(9) for ifnet but doesn't remove the
original ifnet list (ifnet_list) to avoid breaking kvm(3) users. We
shouldn't use the original list in the kernel anymore.

Revision 1.203 / (download) - annotate - [select for diffs], Thu Apr 28 01:37:17 2016 UTC (7 years, 10 months ago) by knakahara
Branch: MAIN
Changes since 1.202: +6 -1 lines
Diff to previous 1.202 (colored)

introduce new ifnet MP-scalable sending interface "if_transmit".

Revision 1.202 / (download) - annotate - [select for diffs], Thu Apr 28 00:16:56 2016 UTC (7 years, 10 months ago) by ozaki-r
Branch: MAIN
Changes since 1.201: +4 -4 lines
Diff to previous 1.201 (colored)

Constify rtentry of if_output

We no longer need to change rtentry below if_output.

The change makes it clear where rtentries are changed (or not)
and helps forthcoming locking (os psrefing) rtentries.

Revision 1.181.2.6 / (download) - annotate - [select for diffs], Fri Apr 22 15:44:17 2016 UTC (7 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.5: +11 -19 lines
Diff to previous 1.181.2.5 (colored) to branchpoint 1.181 (colored)

Sync with HEAD

Revision 1.201 / (download) - annotate - [select for diffs], Wed Apr 20 09:01:04 2016 UTC (7 years, 10 months ago) by knakahara
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422
Changes since 1.200: +7 -17 lines
Diff to previous 1.200 (colored)

IFQ_ENQUEUE refactor (3/3) : eliminate pktattr argument from IFQ_ENQUEUE caller

Revision 1.200 / (download) - annotate - [select for diffs], Wed Apr 20 08:58:48 2016 UTC (7 years, 10 months ago) by knakahara
Branch: MAIN
Changes since 1.199: +4 -8 lines
Diff to previous 1.199 (colored)

IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation

Revision 1.199 / (download) - annotate - [select for diffs], Wed Apr 20 08:56:32 2016 UTC (7 years, 10 months ago) by knakahara
Branch: MAIN
Changes since 1.198: +15 -9 lines
Diff to previous 1.198 (colored)

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

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

Revision 1.181.2.5 / (download) - annotate - [select for diffs], Sat Mar 19 11:30:32 2016 UTC (7 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.4: +16 -37 lines
Diff to previous 1.181.2.4 (colored) to branchpoint 1.181 (colored)

Sync with HEAD

Revision 1.198 / (download) - annotate - [select for diffs], Fri Feb 19 20:05:43 2016 UTC (8 years ago) by roy
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319
Changes since 1.197: +2 -2 lines
Diff to previous 1.197 (colored)

Implement a queue for if_link_state_change() calls to fix a race condition
introduced in the prior patch.

The queue has capacity to store 8 link state changes, if it overflows then
the oldest state change is lost, but the oldest DOWN state change is
preserved to ensure any subsequent UP state changes reflect properly.

Because there are only 3 states to queue, the queue itself is implemented
by storing 2-bit numbers in a bigger one.
To increase the size of the queue, just increase the size of the backing
store to a bigger number.

Revision 1.197 / (download) - annotate - [select for diffs], Tue Feb 16 01:31:26 2016 UTC (8 years ago) by ozaki-r
Branch: MAIN
Changes since 1.196: +1 -36 lines
Diff to previous 1.196 (colored)

Remove workaround for GATEWAY

The workaround was introduced because lltable/llentry uses rwlock
but it may be executed in hardware interrupt due to fast forward.
Now we don't run fast forward in hardware interrupt anymore, so
we can remove the workaround.

Revision 1.196 / (download) - annotate - [select for diffs], Mon Feb 15 08:08:04 2016 UTC (8 years ago) by ozaki-r
Branch: MAIN
Changes since 1.195: +3 -1 lines
Diff to previous 1.195 (colored)

Run if_link_state_change in softint

if_link_state_change can execute the network stack that is expected to
not run in hardware interrupt (at least now), however network drivers
may call it in hardware interrupt. Avoid that by introducing a new
softint for if_link_state_change.

The original patch is provided by mlelstv@ and tweaked a bit by me.

Should fix PR kern/50602.

Revision 1.195 / (download) - annotate - [select for diffs], Tue Feb 9 08:32:12 2016 UTC (8 years ago) by ozaki-r
Branch: MAIN
Changes since 1.194: +13 -3 lines
Diff to previous 1.194 (colored)

Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!

Revision 1.194 / (download) - annotate - [select for diffs], Mon Jan 4 09:08:38 2016 UTC (8 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.193: +5 -3 lines
Diff to previous 1.193 (colored)

Fix the destruction of the afdata lock

Pointed out by mlelstv@

Revision 1.181.2.4 / (download) - annotate - [select for diffs], Sun Dec 27 12:10:06 2015 UTC (8 years, 2 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.3: +37 -3 lines
Diff to previous 1.181.2.3 (colored) to branchpoint 1.181 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.193 / (download) - annotate - [select for diffs], Fri Oct 2 03:08:26 2015 UTC (8 years, 5 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20151226
Changes since 1.192: +2 -2 lines
Diff to previous 1.192 (colored)

Fix typo

Revision 1.192 / (download) - annotate - [select for diffs], Wed Sep 30 07:12:32 2015 UTC (8 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.191: +36 -2 lines
Diff to previous 1.191 (colored)

Make GATEWAY (fastforward) work again

With GATEWAY (fastforward), the whole forwarding processing runs in
hardware interrupt context. So we cannot use rwlock for lltable and
llentry in that case.

This change replaces rwlock with mutex(IPL_NET) for lltable and llentry
when GATEWAY is enabled. We need to tweak locking only around rtree
in lltable_free. Other than that, what we need to do is to change macros
for locks.

I hope fastforward runs in softint some day in the future...

Revision 1.181.2.3 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:10 2015 UTC (8 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.2: +26 -1 lines
Diff to previous 1.181.2.2 (colored) to branchpoint 1.181 (colored)

Sync with HEAD

Revision 1.191 / (download) - annotate - [select for diffs], Mon Aug 31 08:02:44 2015 UTC (8 years, 6 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921
Changes since 1.190: +26 -1 lines
Diff to previous 1.190 (colored)

Hook up lltable/llentry with the kernel (and rumpkernel)

It is built and initialized on bootup, but there is no user for now.

Most codes in in.c are imported from FreeBSD as well as lltable/llentry.

Revision 1.181.2.2 / (download) - annotate - [select for diffs], Sat Jun 6 14:40:25 2015 UTC (8 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181.2.1: +8 -3 lines
Diff to previous 1.181.2.1 (colored) to branchpoint 1.181 (colored)

Sync with HEAD

Revision 1.190 / (download) - annotate - [select for diffs], Mon May 18 06:38:59 2015 UTC (8 years, 9 months ago) by martin
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606
Changes since 1.189: +2 -1 lines
Diff to previous 1.189 (colored)

Implement SIOCIFGCLONERS for netbsd32, so ifconfig -C works.

Revision 1.189 / (download) - annotate - [select for diffs], Sat May 2 14:41:32 2015 UTC (8 years, 10 months ago) by roy
Branch: MAIN
Changes since 1.188: +3 -1 lines
Diff to previous 1.188 (colored)

Add IPv4 address flags IN_IFF_TENTATIVE, IN_IFF_DUPLICATED and
IN_IFF_DETATCHED to mimic the IPv6 address behaviour.
Add SIOCGIFAFLAG_IN ioctl to retrieve the address flag via the
ifreq structure.
Add IPv4 DAD detection via the ARP methods described in RFC 5227.
Add sysctls net.inet.ip.dad_count and net.inet.arp.debug.

Discussed on tech-net@

Revision 1.188 / (download) - annotate - [select for diffs], Mon Apr 20 10:19:54 2015 UTC (8 years, 10 months ago) by roy
Branch: MAIN
Changes since 1.187: +2 -1 lines
Diff to previous 1.187 (colored)

Introduce p2p_rtrequest() so that IFF_POINTOPOINT interfaces can work
with RTF_LOCAL.
Fixes PR kern/49829.

Revision 1.154.8.1 / (download) - annotate - [select for diffs], Thu Apr 16 06:27:33 2015 UTC (8 years, 10 months ago) by snj
Branch: netbsd-6
Changes since 1.154: +4 -5 lines
Diff to previous 1.154 (colored) next main 1.155 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1289):
	sys/net/if.h: revision 1.186
Use 1000ULL to prevent integer overflow (for IF_Gbps(10)). Same as OpenBSD.

Revision 1.174.2.1 / (download) - annotate - [select for diffs], Thu Apr 16 06:08:34 2015 UTC (8 years, 10 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, 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
Changes since 1.174: +4 -5 lines
Diff to previous 1.174 (colored) next main 1.175 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #693):
	sys/net/if.h: revision 1.186
Use 1000ULL to prevent integer overflow (for IF_Gbps(10)). Same as OpenBSD.

Revision 1.187 / (download) - annotate - [select for diffs], Tue Apr 7 23:30:36 2015 UTC (8 years, 10 months ago) by roy
Branch: MAIN
Changes since 1.186: +2 -1 lines
Diff to previous 1.186 (colored)

Move in6if_do_dad() to if_do_dad() as the routine is not INET6 specific
and could equally be used by INET.

Revision 1.181.2.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:22 2015 UTC (8 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.181: +7 -14 lines
Diff to previous 1.181 (colored)

Sync with HEAD

Revision 1.186 / (download) - annotate - [select for diffs], Fri Apr 3 08:20:55 2015 UTC (8 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406
Changes since 1.185: +4 -5 lines
Diff to previous 1.185 (colored)

 Use 1000ULL to prevent integer overflow (for IF_Gbps(10)). Same as OpenBSD.

Revision 1.185 / (download) - annotate - [select for diffs], Fri Jan 16 10:37:51 2015 UTC (9 years, 1 month ago) by ozaki-r
Branch: MAIN
Changes since 1.184: +1 -3 lines
Diff to previous 1.184 (colored)

Remove an outdated snippet for NET_MPSAFE

Revision 1.184 / (download) - annotate - [select for diffs], Mon Dec 15 06:52:25 2014 UTC (9 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.183: +4 -2 lines
Diff to previous 1.183 (colored)

Introduce if_initialize and if_register as an alternative to if_attach

if_attach initializes an ifnet object and registers it to the system
(e.g., ifnet_list), however, if_attach doesn't complete the
initialization and the rest of it will be done by if_alloc_sadl
that is normally directly called by device drivers or called via
functions like ether_ifattach. So there is a race between
if_attach and if_alloc_sadl (A half-baked ifnet object may be
accessed, for example, via ioctl between them).

The aim of this fix is to register an initializing ifnet object
after completing its initializations. To this end, this fix
separates if_attach into an initialization part (if_initialize)
and a registration part (if_register) and call the latter after
if_alloc_sadl (ether_ifattach). So a typical usage of the two
new APIs is like this:

  if_initialize(ifp);  // was if_attach
  ether_ifattach(ifp, enaddr);
  if_register(ifp);

Nonetheless, changing every drivers to do so at once isn't
feasible. So we keep if_attach working as it used to be and
will change only some drivers that we need at this point.
Once we know the fix really works well, we'll change all
the others.

Some more information of the fix can be found here:
http://mail-index.netbsd.org/tech-kern/2014/12/10/msg018242.html

No objection on tech-kern and tech-net.

Revision 1.183 / (download) - annotate - [select for diffs], Tue Dec 2 04:43:35 2014 UTC (9 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.182: +1 -2 lines
Diff to previous 1.182 (colored)

Revert "Pull if_drain routine out of m_reclaim"

The commit broke dlopen()'d rumpnet on platforms where ld.so does not
override weak aliases (e.g. musl, Solaris, potentially OS X, ...).

Requested by pooka@.

Revision 1.182 / (download) - annotate - [select for diffs], Mon Dec 1 07:15:42 2014 UTC (9 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.181: +1 -6 lines
Diff to previous 1.181 (colored)

Make more functions static

No functional change.

Revision 1.181 / (download) - annotate - [select for diffs], Fri Nov 28 08:29:00 2014 UTC (9 years, 3 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.180: +1 -2 lines
Diff to previous 1.180 (colored)

Remove dead codes and make if_free_sadl static

No functional change.

Revision 1.180 / (download) - annotate - [select for diffs], Thu Nov 27 03:15:51 2014 UTC (9 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.179: +2 -1 lines
Diff to previous 1.179 (colored)

Pull if_drain routine out of m_reclaim

It's if-specific and should be in if.c.

No functional change.

Revision 1.179 / (download) - annotate - [select for diffs], Wed Nov 26 09:38:42 2014 UTC (9 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.178: +3 -2 lines
Diff to previous 1.178 (colored)

Change if_slowtimo_ch to a pointer

One benefit to do so is to reduce memory used for struct callout;
we can avoid to allocate struct callout for interfaces that don't
use callout.

Requested by uebayasi@.

Revision 1.178 / (download) - annotate - [select for diffs], Wed Nov 26 07:43:04 2014 UTC (9 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.177: +5 -1 lines
Diff to previous 1.177 (colored)

Create if_slowtimo (if_watchdog) callout for each interface

This change is to obviate the need to run if_slowtimo callbacks that
may sleep inside IFNET_FOREACH. And also by this change we can turn
on MPSAFE of callouts individually.

Discussed with uebayasi@ and riastradh@.

Revision 1.177 / (download) - annotate - [select for diffs], Wed Nov 26 07:22:05 2014 UTC (9 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.176: +6 -4 lines
Diff to previous 1.176 (colored)

Rename if_watchdog to if_slowtimo

if_watchdog callbacks do a little more than what "watchdog" suggests.

Discussed with uebayasi@ (the idea originally from openbsd-tech).

Revision 1.176 / (download) - annotate - [select for diffs], Wed Nov 26 07:06:03 2014 UTC (9 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.175: +1 -2 lines
Diff to previous 1.175 (colored)

Make if_slowtimo static

Revision 1.175 / (download) - annotate - [select for diffs], Tue Sep 9 20:16:12 2014 UTC (9 years, 5 months ago) by rmind
Branch: MAIN
Changes since 1.174: +4 -39 lines
Diff to previous 1.174 (colored)

Eliminate IFAREF() and IFAFREE() macros in favour of functions.

Revision 1.154.12.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:34 2014 UTC (9 years, 6 months ago) by tls
Branch: tls-maxphys
Changes since 1.154.12.1: +79 -30 lines
Diff to previous 1.154.12.1 (colored) to branchpoint 1.154 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.161.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:56:15 2014 UTC (9 years, 6 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.161: +74 -30 lines
Diff to previous 1.161 (colored) next main 1.162 (colored)

Rebase.

Revision 1.174 / (download) - annotate - [select for diffs], Thu Jul 31 06:35:47 2014 UTC (9 years, 7 months ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base
Branch point for: netbsd-7
Changes since 1.173: +4 -1 lines
Diff to previous 1.173 (colored)

Define IFADDR_FOREACH_SAFE for on-the-fly element removal in a loop

We have to use it when we purge an address element in an ifaddr loop.

This change restores the original behavior that was accidentally degraded.

Revision 1.173 / (download) - annotate - [select for diffs], Thu Jul 31 02:21:51 2014 UTC (9 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.172: +2 -1 lines
Diff to previous 1.172 (colored)

Define IFNET_EMPTY() and replace !IFNET_FIRST() with it

No functional change.

Revision 1.172 / (download) - annotate - [select for diffs], Wed Jul 16 03:17:26 2014 UTC (9 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.171: +6 -3 lines
Diff to previous 1.171 (colored)

Kill void * for bridge in struct ifnet

No functional change.

Revision 1.171 / (download) - annotate - [select for diffs], Mon Jul 14 02:34:36 2014 UTC (9 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.170: +2 -1 lines
Diff to previous 1.170 (colored)

Make bridge MPSAFE

- Introduce BRIDGE_MPSAFE
  - It's enabled only when NET_MPSAFE is defined
    in if.h or the kernel config
- Add iflist and rtlist mutex locks
  - Locking iflist is performance sensitive,
    so it's not used when !BRIDGE_MPSAFE
- Add bif object reference counting
  - It enables fine-grain locking for bridge member lists
    by allowing to not hold a lock during touching a bif
  - bridge_release_member is added to decrement the
    reference count
  - A condition variable is added to do bridge_delete_member
    gracefully
- Add if_bridgeif to ifnet
  - It's a shortcut to a bif object of a bridge member
  - It reduces a bif lookup cost and so lock contention on iflist
- Make bridgestp MPSAFE too

Revision 1.170 / (download) - annotate - [select for diffs], Tue Jul 1 14:04:40 2014 UTC (9 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.169: +2 -2 lines
Diff to previous 1.169 (colored)

Unbreak lib/libc/net/getifaddrs.c

  --- getifaddrs.o ---
  In file included from /tmp/bracket/build/2014.07.01.10.35.18-i386/src/lib/libc/net/getifaddrs.c:39:0:
  /tmp/bracket/build/2014.07.01.10.35.18-i386/src/sys/net/if.h:208:2: error: unknown type name 'kmutex_t'
    kmutex_t *ifq_lock;
      ^

Revision 1.169 / (download) - annotate - [select for diffs], Tue Jul 1 10:16:02 2014 UTC (9 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.168: +42 -9 lines
Diff to previous 1.168 (colored)

Lock IFQ operations when NET_MPSAFE

- Introduce NET_MPSAFE
  - not defined by default
- Add ifq_lock to protect ifnet#if_snd
- Initialize ifq_lock and lock IFQ operations
  when NET_MPSAFE

When NET_MPSAFE isn't defined, this modification
doesn't change its behavior and adds trivial
performance overheads.

Discussed with matt@ on tech-net

Revision 1.168 / (download) - annotate - [select for diffs], Tue Jul 1 05:49:18 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.167: +2 -3 lines
Diff to previous 1.167 (colored)

fix parameter types in pr_ioctl, called xx_control() functions and remove
abuse of pointer to struct mbuf type.

param2 changed to u_long type and uses parameter name 'cmd' (ioctl command)
param3 changed to void * type and uses parameter name 'data'
param4 changed to struct ifnet * and uses parameter name 'ifp'
param5 has been removed (formerly struct lwp *) and uses of 'l' have been
       replaced with curlwp from curproc(9).

callers have had (now unnecessary) casts to struct mbuf * removed, called
code has had (now unnecessary) casts to u_long, void * and struct ifnet *
respectively removed.

reviewed by rmind@

Revision 1.167 / (download) - annotate - [select for diffs], Mon Jun 16 03:43:10 2014 UTC (9 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.166: +3 -1 lines
Diff to previous 1.166 (colored)

Include pktqueue.h only if _KERNEL

Revision 1.166 / (download) - annotate - [select for diffs], Mon Jun 16 00:40:10 2014 UTC (9 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.165: +3 -1 lines
Diff to previous 1.165 (colored)

Move sysctl_pktq_{maxlen,count} to pktqueue.c and make them global

They will be used by bridge.

ok rmind@

Revision 1.154.2.2 / (download) - annotate - [select for diffs], Thu May 22 11:41:08 2014 UTC (9 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.154.2.1: +11 -4 lines
Diff to previous 1.154.2.1 (colored) to branchpoint 1.154 (colored) next main 1.155 (colored)

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.155.2.3 / (download) - annotate - [select for diffs], Sun May 18 17:46:12 2014 UTC (9 years, 9 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.155.2.2: +10 -3 lines
Diff to previous 1.155.2.2 (colored) to branchpoint 1.155 (colored) next main 1.156 (colored)

sync with head

Revision 1.165 / (download) - annotate - [select for diffs], Sun May 18 00:33:20 2014 UTC (9 years, 9 months ago) by rmind
Branch: MAIN
CVS Tags: rmind-smpnet-nbase, rmind-smpnet-base
Changes since 1.164: +6 -8 lines
Diff to previous 1.164 (colored)

- Move ifnet_list (and lo0ifp while here) under #ifdef _KERNEL.
- Make ifindex2ifnet, if_indexlim and some other variables static.
- Move if_index generation into its own function.
- if_alloc/if_free: replace malloc with kmem.

Revision 1.164 / (download) - annotate - [select for diffs], Sat May 17 20:44:24 2014 UTC (9 years, 9 months ago) by rmind
Branch: MAIN
Changes since 1.163: +10 -10 lines
Diff to previous 1.163 (colored)

- Move IFNET_*() macros under #ifdef _KERNEL.
- Replace TAILQ_FOREACH on ifnet with IFNET_FOREACH().

Revision 1.163 / (download) - annotate - [select for diffs], Sat Apr 26 11:16:22 2014 UTC (9 years, 10 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9
Changes since 1.162: +2 -2 lines
Diff to previous 1.162 (colored)

Decouple sockets linkage from interface code by making ifioctl() a pointer.

Revision 1.162 / (download) - annotate - [select for diffs], Thu Apr 17 15:45:39 2014 UTC (9 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.161: +5 -3 lines
Diff to previous 1.161 (colored)

add LRO

Revision 1.161 / (download) - annotate - [select for diffs], Wed Mar 12 12:59:57 2014 UTC (9 years, 11 months ago) by pooka
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.160: +3 -1 lines
Diff to previous 1.160 (colored)

add a mask for valid capabilities

also add a comment stating why capabilities start from 0x80

Revision 1.160 / (download) - annotate - [select for diffs], Sat Jan 25 21:10:29 2014 UTC (10 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.159: +2 -1 lines
Diff to previous 1.159 (colored)

add a lint comment

Revision 1.159 / (download) - annotate - [select for diffs], Mon Oct 28 21:38:01 2013 UTC (10 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.158: +3 -2 lines
Diff to previous 1.158 (colored)

add an alias for the linux name for the interface index

Revision 1.158 / (download) - annotate - [select for diffs], Sat Oct 5 23:22:34 2013 UTC (10 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.157: +2 -2 lines
Diff to previous 1.157 (colored)

fix the source too, not just the doc.

Revision 1.157 / (download) - annotate - [select for diffs], Sat Oct 5 23:16:54 2013 UTC (10 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.156: +2 -1 lines
Diff to previous 1.156 (colored)

Add SIOCGIFINDEX from Ty Sarna and Matthew Sporleder.

Revision 1.155.2.2 / (download) - annotate - [select for diffs], Wed Aug 28 23:59:36 2013 UTC (10 years, 6 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.155.2.1: +2 -2 lines
Diff to previous 1.155.2.1 (colored) to branchpoint 1.155 (colored)

sync with head

Revision 1.155.2.1 / (download) - annotate - [select for diffs], Wed Jul 17 03:16:31 2013 UTC (10 years, 7 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.155: +13 -15 lines
Diff to previous 1.155 (colored)

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.156 / (download) - annotate - [select for diffs], Sat Jun 29 21:06:58 2013 UTC (10 years, 8 months ago) by rmind
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Changes since 1.155: +2 -2 lines
Diff to previous 1.155 (colored)

- Rewrite parts of pfil(9): use array to store hooks and thus be more cache
  friendly (there are only few hooks in the system).  Make the structures
  opaque and the interface more strict.
- Remove PFIL_HOOKS option by making pfil(9) mandatory.

Revision 1.154.12.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:02:46 2012 UTC (11 years, 3 months ago) by tls
Branch: tls-maxphys
Changes since 1.154: +1 -3 lines
Diff to previous 1.154 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.154.2.1 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:42 2012 UTC (11 years, 4 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.154: +1 -3 lines
Diff to previous 1.154 (colored)

sync with head

Revision 1.155 / (download) - annotate - [select for diffs], Thu Oct 25 11:53:14 2012 UTC (11 years, 4 months ago) by msaitoh
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.154: +1 -3 lines
Diff to previous 1.154 (colored)

Move the prototype definition of ether_input() from if.h to if_ether.h.

Revision 1.140.8.3 / (download) - annotate - [select for diffs], Sat Dec 24 01:59:30 2011 UTC (12 years, 2 months ago) by matt
Branch: matt-nb5-mips64
Changes since 1.140.8.2: +4 -2 lines
Diff to previous 1.140.8.2 (colored) to branchpoint 1.140 (colored) next main 1.141 (colored)

Make this compile if COMPAT_14 is defined.

Revision 1.154 / (download) - annotate - [select for diffs], Tue Oct 25 22:26:18 2011 UTC (12 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, 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, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, 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, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, tls-maxphys, netbsd-6
Changes since 1.153: +17 -5 lines
Diff to previous 1.153 (colored)

Document the ifioctl locking in comments.

Add a missing percpu_free(9) call.

Revision 1.153 / (download) - annotate - [select for diffs], Wed Oct 19 21:29:51 2011 UTC (12 years, 4 months ago) by dyoung
Branch: MAIN
Changes since 1.152: +18 -9 lines
Diff to previous 1.152 (colored)

Fix userland compilation: pull the ifioctl lock-related data members
into a struct ifnet_lock that the ifnet has a pointer to.  In a
non-_KERNEL environment, don't #include <sys/percpu.h> et cetera, and
don't define the struct ifnet_lock but *do* declare it.

Revision 1.152 / (download) - annotate - [select for diffs], Wed Oct 19 01:34:37 2011 UTC (12 years, 4 months ago) by dyoung
Branch: MAIN
Changes since 1.151: +17 -1 lines
Diff to previous 1.151 (colored)

Start to untangle the ifnet ioctls mess.

Add ifnet functions, if_mcast_op(), if_flags_set(), and if_addr_init()
for adding/deleting multicast addresses, modifying the if_flags,
and initializing local/remote addresses.  Make ifpromisc() use
if_flags_set().  Protocols and network drivers should use these
instead of ifp->if_ioctl() calls.  Subsequent commits will
replace ifp->if_ioctl(SIOCADDMULTI| SIOCDELMULTI| SIOCSIFDSTADDR|
SIOCINITIFADDR| SIOCSIFFLAGS) calls with calls to the new functions.

Use a mutex(9) to synchronize ifp->if_ioctl() calls originating in
userland.  Also synchronize ifp->if_ioctl() calls with ifnet detachment
and reclamation.

Revision 1.151 / (download) - annotate - [select for diffs], Fri Aug 12 22:09:17 2011 UTC (12 years, 6 months ago) by dyoung
Branch: MAIN
Changes since 1.150: +2 -1 lines
Diff to previous 1.150 (colored)

Declare if_free().

Revision 1.148.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:09:52 2011 UTC (12 years, 9 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.148: +26 -10 lines
Diff to previous 1.148 (colored) next main 1.149 (colored)

Sync with HEAD.

Revision 1.146.4.1 / (download) - annotate - [select for diffs], Sat Mar 5 20:55:51 2011 UTC (13 years ago) by rmind
Branch: rmind-uvmplock
Changes since 1.146: +28 -11 lines
Diff to previous 1.146 (colored) next main 1.147 (colored)

sync with head

Revision 1.149.2.1 / (download) - annotate - [select for diffs], Tue Feb 8 16:20:01 2011 UTC (13 years ago) by bouyer
Branch: bouyer-quota2
Changes since 1.149: +20 -8 lines
Diff to previous 1.149 (colored) next main 1.150 (colored)

Sync with HEAD

Revision 1.150 / (download) - annotate - [select for diffs], Tue Feb 1 01:39:20 2011 UTC (13 years, 1 month ago) by matt
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base
Changes since 1.149: +20 -8 lines
Diff to previous 1.149 (colored)

Add a new AF/PF_ROUTE which is 64-bit clean which makes the routing socket
interface (and its associated sysctls) act identically for both 32 and 64 bit
programs.  The old unclean one remains for backward compatibility.

Revision 1.149 / (download) - annotate - [select for diffs], Tue Jan 18 20:33:45 2011 UTC (13 years, 1 month ago) by rmind
Branch: MAIN
Branch point for: bouyer-quota2
Changes since 1.148: +7 -3 lines
Diff to previous 1.148 (colored)

NPF checkpoint:
- Add the concept of rule procedure: separate normalization, logging and
  potentially other functions from the rule structure.  Rule procedure can be
  shared amongst the rules.  Separation is both at kernel level (npf_rproc_t)
  and configuration ("procedure" + "apply").
- Fix portmap sharing for NAT policy.
- Update TCP state tracking logic.  Use TCP FSM definitions.
- Add if_byindex(), OK by matt@.  Use in logging for the lookup.
- Fix traceroute ALG and many other bugs; misc clean-up.

Revision 1.148 / (download) - annotate - [select for diffs], Mon Nov 15 22:42:36 2010 UTC (13 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr
Changes since 1.147: +3 -1 lines
Diff to previous 1.147 (colored)

Implement ifconfig linkstr as proposed on tech-net.

Revision 1.146.2.1 / (download) - annotate - [select for diffs], Fri Oct 22 07:22:38 2010 UTC (13 years, 4 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.146: +1 -2 lines
Diff to previous 1.146 (colored) next main 1.147 (colored)

Sync with HEAD (-D20101022).

Revision 1.147 / (download) - annotate - [select for diffs], Wed Oct 20 15:02:17 2010 UTC (13 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: uebayasi-xip-base4, uebayasi-xip-base3
Changes since 1.146: +1 -2 lines
Diff to previous 1.146 (colored)

Remove XXX comment with the text "going away soon".  It was added
in September 1989 -- I think we passed "soon" around last week.

Revision 1.140.8.2 / (download) - annotate - [select for diffs], Thu May 13 05:51:47 2010 UTC (13 years, 9 months ago) by matt
Branch: matt-nb5-mips64
CVS Tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Changes since 1.140.8.1: +2 -1 lines
Diff to previous 1.140.8.1 (colored) to branchpoint 1.140 (colored)

Add a spare int field to ifa_msghdr so its length is a multiple of 8.

Revision 1.140.8.1 / (download) - annotate - [select for diffs], Tue May 11 21:00:13 2010 UTC (13 years, 9 months ago) by matt
Branch: matt-nb5-mips64
Changes since 1.140: +6 -2 lines
Diff to previous 1.140 (colored)

A few changes that make the route interface and related sysctls 32/64 bit
independent so the netbsd32 userland can use them.

Revision 1.134.12.5 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:26 2010 UTC (13 years, 11 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.134.12.4: +16 -16 lines
Diff to previous 1.134.12.4 (colored) to branchpoint 1.134 (colored) next main 1.135 (colored)

sync with head

Revision 1.146 / (download) - annotate - [select for diffs], Sun Jan 17 19:45:06 2010 UTC (14 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.145: +2 -2 lines
Diff to previous 1.145 (colored)

Forward declare struct bpf_if and use that as the type for bpf_if
instead of "void *".  Buys us oo times the type-safety for 0 times
the price.
(no functional change)

Revision 1.145 / (download) - annotate - [select for diffs], Mon Oct 5 21:25:05 2009 UTC (14 years, 5 months ago) by dyoung
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase
Changes since 1.144: +15 -15 lines
Diff to previous 1.144 (colored)

Replace u_quad_t with uint64_t.  u_quad_t is just a typedef for
uint64_t, so no ABI/API breakage will result from this change.

Revision 1.134.12.4 / (download) - annotate - [select for diffs], Wed Sep 16 13:38:01 2009 UTC (14 years, 5 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.134.12.3: +3 -1 lines
Diff to previous 1.134.12.3 (colored) to branchpoint 1.134 (colored)

sync with head

Revision 1.144 / (download) - annotate - [select for diffs], Fri Sep 11 22:06:29 2009 UTC (14 years, 5 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8
Changes since 1.143: +3 -1 lines
Diff to previous 1.143 (colored)

Make ifconfig(8) set and display preference numbers for IPv6
addresses.  Make the kernel support SIOC[SG]IFADDRPREF for IPv6
interface addresses.

In in6ifa_ifpforlinklocal(), consult preference numbers before
making an otherwise arbitrary choice of in6_ifaddr.  Otherwise,
preference numbers are *not* consulted by the kernel, but that will
be rather easy for somebody with a little bit of free time to fix.

Please note that setting the preference number for a link-local
IPv6 address does not work right, yet, but that ought to be fixed
soon.

In support of the changes above,

1 Add a method to struct domain for "externalizing" a sockaddr, and
  provide an implementation for IPv6.  Expect more work in this area: it
  may be more proper to say that the IPv6 implementation "internalizes"
  a sockaddr.  Add sockaddr_externalize().

2 Add a subroutine, sofamily(), that returns a struct socket's address
  family or AF_UNSPEC.

3 Make a lot of IPv4-specific code generic, and move it from
  sys/netinet/ to sys/net/ for re-use by IPv6 parts of the kernel and
  ifconfig(8).

Revision 1.134.12.3 / (download) - annotate - [select for diffs], Wed Aug 19 18:48:23 2009 UTC (14 years, 6 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.134.12.2: +16 -1 lines
Diff to previous 1.134.12.2 (colored) to branchpoint 1.134 (colored)

sync with head.

Revision 1.143 / (download) - annotate - [select for diffs], Thu Aug 13 00:23:32 2009 UTC (14 years, 6 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base7
Changes since 1.142: +16 -1 lines
Diff to previous 1.142 (colored)

Use sysctl(9) to expose to userland each interface transmission
queue's maximum length, current length, and number of drops.  E.g.,

% sysctl net.interfaces.bnx0
net.interfaces.bnx0.sndq.len = 0
net.interfaces.bnx0.sndq.maxlen = 509
net.interfaces.bnx0.sndq.drops = 0

Let userland adjust the maximum queue length.

While I'm here, add a 64-bit generation number, if_index_gen, to
ifnet; the pair [ifp->if_index, ifp->if_index_gen] can serve to
identify an ifnet for the lifetime of the system.  I will use this
in an upcoming change.

Ok matt@.

Revision 1.134.12.2 / (download) - annotate - [select for diffs], Mon May 4 08:14:14 2009 UTC (14 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.134.12.1: +27 -46 lines
Diff to previous 1.134.12.1 (colored) to branchpoint 1.134 (colored)

sync with head.

Revision 1.140.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:20:11 2009 UTC (15 years, 1 month ago) by skrll
Branch: nick-hppapmap
Changes since 1.140: +15 -43 lines
Diff to previous 1.140 (colored) next main 1.141 (colored)

Sync with HEAD.

Revision 1.134.6.3 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:30 2009 UTC (15 years, 1 month ago) by mjf
Branch: mjf-devfs2
Changes since 1.134.6.2: +17 -45 lines
Diff to previous 1.134.6.2 (colored) to branchpoint 1.134 (colored) next main 1.135 (colored)

Sync with HEAD.

Revision 1.142 / (download) - annotate - [select for diffs], Sun Jan 11 02:45:54 2009 UTC (15 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, mjf-devfs2-base, jymxensuspend-base, jym-xensuspend-base, jym-xensuspend
Changes since 1.141: +2 -41 lines
Diff to previous 1.141 (colored)

merge christos-time_t

Revision 1.139.2.1 / (download) - annotate - [select for diffs], Sat Dec 13 01:15:25 2008 UTC (15 years, 2 months ago) by haad
Branch: haad-dm
Changes since 1.139: +17 -6 lines
Diff to previous 1.139 (colored) next main 1.140 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.134.8.3 / (download) - annotate - [select for diffs], Sun Nov 9 23:57:23 2008 UTC (15 years, 3 months ago) by christos
Branch: christos-time_t
Changes since 1.134.8.2: +14 -3 lines
Diff to previous 1.134.8.2 (colored) to branchpoint 1.134 (colored) next main 1.135 (colored)

merge with head.

Revision 1.141 / (download) - annotate - [select for diffs], Fri Nov 7 00:20:13 2008 UTC (15 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: haad-nbase2, haad-dm-base2, haad-dm-base, christos-time_t-nbase, christos-time_t-base, ad-audiomp2-base, ad-audiomp2
Changes since 1.140: +14 -3 lines
Diff to previous 1.140 (colored)

*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address.  (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior.  Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability.  KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR.  In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr.  That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR.  In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR.  For example, pull ..._init() out of any switch
statement that looks like this:

        switch (...->sa_family) {
        case ...:
                ..._init();
                ...
                break;
        ...
        default:
                ..._init();
                ...
                break;
        }

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

        switch (x & (IFF_UP|IFF_RUNNING)) {
        case 0:
                ...
                break;
        case IFF_RUNNING:
                ...
                break;
        case IFF_UP:
                ...
                break;
        case IFF_UP|IFF_RUNNING:
                ...
                break;
        }

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure.  Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls.  In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source.  In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively.  Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset.  Delete unnecessary casts to void *.  Use
sockaddr_in_init() and sockaddr_in6_init().  Compare pointers with
NULL instead of "testing truth".  Replace some instances of (type
*)0 with NULL.  Change some K&R prototypes to ANSI C, and join
lines.

Revision 1.134.8.2 / (download) - annotate - [select for diffs], Sat Nov 1 21:22:28 2008 UTC (15 years, 4 months ago) by christos
Branch: christos-time_t
Changes since 1.134.8.1: +17 -12 lines
Diff to previous 1.134.8.1 (colored) to branchpoint 1.134 (colored)

Sync with head.

Revision 1.140 / (download) - annotate - [select for diffs], Fri Oct 24 17:07:33 2008 UTC (15 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: 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, 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-20091211, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2
Branch point for: nick-hppapmap, matt-nb5-mips64
Changes since 1.139: +4 -4 lines
Diff to previous 1.139 (colored)

Constify the rt_addrinfo argument to the ifa_rtrequest member
function of struct ifaddr.

Revision 1.134.6.2 / (download) - annotate - [select for diffs], Sun Jun 29 09:33:18 2008 UTC (15 years, 8 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.134.6.1: +9 -0 lines
Diff to previous 1.134.6.1 (colored) to branchpoint 1.134 (colored)

Sync with HEAD.

Revision 1.135.2.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:57 2008 UTC (15 years, 8 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.135: +14 -2 lines
Diff to previous 1.135 (colored) next main 1.136 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.137.2.1 / (download) - annotate - [select for diffs], Wed Jun 18 16:33:50 2008 UTC (15 years, 8 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.137: +10 -1 lines
Diff to previous 1.137 (colored) next main 1.138 (colored)

Sync with head.

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

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

ok'ed by peter@.  requested by core@

Revision 1.134.10.3 / (download) - annotate - [select for diffs], Tue Jun 17 09:15:13 2008 UTC (15 years, 8 months ago) by yamt
Branch: yamt-pf42
Changes since 1.134.10.2: +3 -1 lines
Diff to previous 1.134.10.2 (colored) to branchpoint 1.134 (colored) next main 1.135 (colored)

sync with head.

Revision 1.138 / (download) - annotate - [select for diffs], Sun Jun 15 16:37:21 2008 UTC (15 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-base4
Changes since 1.137: +3 -1 lines
Diff to previous 1.137 (colored)

- add if_alloc (ours just mallocs), and if_initname and use them (from FreeBSD)
- kill memsets where M_ZERO can be used.

Revision 1.134.6.1 / (download) - annotate - [select for diffs], Mon Jun 2 13:24:21 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.134: +5 -9 lines
Diff to previous 1.134 (colored)

Sync with HEAD.

Revision 1.134.10.2 / (download) - annotate - [select for diffs], Sun May 18 12:35:26 2008 UTC (15 years, 9 months ago) by yamt
Branch: yamt-pf42
Changes since 1.134.10.1: +5 -9 lines
Diff to previous 1.134.10.1 (colored) to branchpoint 1.134 (colored)

sync with head.

Revision 1.134.12.1 / (download) - annotate - [select for diffs], Fri May 16 02:25:40 2008 UTC (15 years, 9 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.134: +5 -9 lines
Diff to previous 1.134 (colored)

sync with head.

Revision 1.137 / (download) - annotate - [select for diffs], Tue May 13 18:09:22 2008 UTC (15 years, 9 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, hpcarm-cleanup-nbase
Branch point for: simonb-wapbl
Changes since 1.136: +3 -1 lines
Diff to previous 1.136 (colored)

Let us call ioctl(SIOC[ADG]LIFADDR) with a link-layer address on
an AF_LINK socket, only, to be consistent with SIOC[ADG]LIFADDR
behavior on AF_INET and AF_INET6 sockets.  Let us create AF_LINK
sockets for this purpose.  Note that most operations on AF_LINK
sockets are not implemented.

Revision 1.136 / (download) - annotate - [select for diffs], Sun May 11 23:48:07 2008 UTC (15 years, 9 months ago) by dyoung
Branch: MAIN
Changes since 1.135: +3 -2 lines
Diff to previous 1.135 (colored)

Add kernel support for adding/removing link-layer addresses using
SIOCALIFADDR AND SIOCDLIFADDR, respectively.  Corresponding
ifconfig(8) changes are coming soon.

Revision 1.135 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:09 2008 UTC (15 years, 10 months ago) by martin
Branch: MAIN
Branch point for: wrstuden-revivesa
Changes since 1.134: +1 -8 lines
Diff to previous 1.134 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.134.10.1 / (download) - annotate - [select for diffs], Sat Apr 19 08:33:27 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.134: +8 -1 lines
Diff to previous 1.134 (colored)

Peter Postma's work-in-progress pf import from OpenBSD 4.2.
updated to -current by me.

Revision 1.134.8.1 / (download) - annotate - [select for diffs], Sat Mar 29 20:47:02 2008 UTC (15 years, 11 months ago) by christos
Branch: christos-time_t
Changes since 1.134: +2 -41 lines
Diff to previous 1.134 (colored)

Welcome to the time_t=long long dev_t=uint64_t branch.

Revision 1.124.8.3 / (download) - annotate - [select for diffs], Sun Mar 23 02:05:04 2008 UTC (15 years, 11 months ago) by matt
Branch: matt-armv6
Changes since 1.124.8.2: +5 -1 lines
Diff to previous 1.124.8.2 (colored) to branchpoint 1.124 (colored) next main 1.125 (colored)

sync with HEAD

Revision 1.127.6.3 / (download) - annotate - [select for diffs], Mon Feb 18 21:07:01 2008 UTC (16 years ago) by mjf
Branch: mjf-devfs
Changes since 1.127.6.2: +5 -1 lines
Diff to previous 1.127.6.2 (colored) to branchpoint 1.127 (colored) next main 1.128 (colored)

Sync with HEAD.

Revision 1.110.2.9 / (download) - annotate - [select for diffs], Mon Feb 11 14:59:59 2008 UTC (16 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.110.2.8: +4 -1 lines
Diff to previous 1.110.2.8 (colored) next main 1.111 (colored)

sync with head.

Revision 1.134 / (download) - annotate - [select for diffs], Thu Feb 7 01:21:59 2008 UTC (16 years, 1 month ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp, mjf-devfs2, christos-time_t
Changes since 1.133: +4 -1 lines
Diff to previous 1.133 (colored)

Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs.  This will ease extending the kernel and sharing of code
between drivers.

First steps:  Make the signature of ifioctl_common() match struct
ifinet->if_ioctl.  Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.

Revision 1.110.2.8 / (download) - annotate - [select for diffs], Mon Feb 4 09:24:37 2008 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.110.2.7: +2 -1 lines
Diff to previous 1.110.2.7 (colored)

sync with head.

Revision 1.130.4.2 / (download) - annotate - [select for diffs], Wed Jan 23 19:27:44 2008 UTC (16 years, 1 month ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.130.4.1: +1 -0 lines
Diff to previous 1.130.4.1 (colored) to branchpoint 1.130 (colored) next main 1.131 (colored)

Sync with HEAD.

Revision 1.133 / (download) - annotate - [select for diffs], Tue Jan 22 16:25:16 2008 UTC (16 years, 1 month ago) by dyoung
Branch: MAIN
CVS Tags: bouyer-xeni386-nbase
Changes since 1.132: +2 -1 lines
Diff to previous 1.132 (colored)

Take two steps toward adding and deleting link-layer addresses.

1 Extract subroutine if_dl_create() from if_alloc_sadl().
  if_dl_create() allocates a link-layer ifaddr.

2 Extract subroutine ifioctl_common() from ifioctl().  ifioctl_common()
  will be the basis for an ifnet "superclass" whose functions
  drivers may inherit.  Very simple drivers may set ifnet->if_ioctl
  = ifioctl_common.  More sophisticated drivers will set ifnet->if_ioctl
  = driver_ioctl.  driver_ioctl() will call ifioctl_common() to
  re-use the common code.

Revision 1.110.2.7 / (download) - annotate - [select for diffs], Mon Jan 21 09:47:00 2008 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.110.2.6: +4 -2 lines
Diff to previous 1.110.2.6 (colored)

sync with head

Revision 1.124.8.2 / (download) - annotate - [select for diffs], Wed Jan 9 01:57:08 2008 UTC (16 years, 1 month ago) by matt
Branch: matt-armv6
Changes since 1.124.8.1: +16 -5 lines
Diff to previous 1.124.8.1 (colored) to branchpoint 1.124 (colored)

sync with HEAD

Revision 1.130.4.1 / (download) - annotate - [select for diffs], Wed Jan 2 21:57:01 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.130: +4 -2 lines
Diff to previous 1.130 (colored)

Sync with HEAD

Revision 1.127.6.2 / (download) - annotate - [select for diffs], Thu Dec 27 00:46:27 2007 UTC (16 years, 2 months ago) by mjf
Branch: mjf-devfs
Changes since 1.127.6.1: +4 -2 lines
Diff to previous 1.127.6.1 (colored) to branchpoint 1.127 (colored)

Sync with HEAD.

Revision 1.127.8.2 / (download) - annotate - [select for diffs], Wed Dec 26 21:39:51 2007 UTC (16 years, 2 months ago) by ad
Branch: vmlocking2
Changes since 1.127.8.1: +4 -2 lines
Diff to previous 1.127.8.1 (colored) to branchpoint 1.127 (colored) next main 1.128 (colored)

Sync with head.

Revision 1.132 / (download) - annotate - [select for diffs], Thu Dec 20 21:08:20 2007 UTC (16 years, 2 months ago) by dyoung
Branch: MAIN
CVS Tags: vmlocking2-base3, matt-armv6-base, bouyer-xeni386-base
Changes since 1.131: +3 -2 lines
Diff to previous 1.131 (colored)

Constify struct ifnet->if_sadl and every use throughout the tree.
Add if_set_sadl() that both sets the link-layer address length and
replaces the current link-layer address with a new one, and use it
throughout the tree.

Revision 1.131 / (download) - annotate - [select for diffs], Thu Dec 20 19:53:30 2007 UTC (16 years, 2 months ago) by dyoung
Branch: MAIN
Changes since 1.130: +2 -1 lines
Diff to previous 1.130 (colored)

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.124.6.3 / (download) - annotate - [select for diffs], Sun Dec 9 19:38:33 2007 UTC (16 years, 2 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.124.6.2: +13 -4 lines
Diff to previous 1.124.6.2 (colored) to branchpoint 1.124 (colored) next main 1.125 (colored)

Sync with HEAD.

Revision 1.127.6.1 / (download) - annotate - [select for diffs], Sat Dec 8 18:21:05 2007 UTC (16 years, 3 months ago) by mjf
Branch: mjf-devfs
Changes since 1.127: +13 -4 lines
Diff to previous 1.127 (colored)

Sync with HEAD.

Revision 1.127.8.1 / (download) - annotate - [select for diffs], Sat Dec 8 17:57:53 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.127: +13 -4 lines
Diff to previous 1.127 (colored)

Sync with head.

Revision 1.110.2.6 / (download) - annotate - [select for diffs], Fri Dec 7 17:34:15 2007 UTC (16 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.110.2.5: +13 -4 lines
Diff to previous 1.110.2.5 (colored)

sync with head

Revision 1.130 / (download) - annotate - [select for diffs], Thu Dec 6 00:23:09 2007 UTC (16 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base2, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: bouyer-xeni386
Changes since 1.129: +4 -1 lines
Diff to previous 1.129 (colored)

Add ifa_insert() and ifa_remove() that add/remove an ifaddr to/from
an interface and increase/decrease its reference count.

Revision 1.129 / (download) - annotate - [select for diffs], Wed Dec 5 23:47:17 2007 UTC (16 years, 3 months ago) by dyoung
Branch: MAIN
Changes since 1.128: +2 -1 lines
Diff to previous 1.128 (colored)

Extract common code, creating a subroutine if_purgeaddrs(ifp,
family, purgeaddr) which applies function `purgeaddr' to each
address on `ifp' belonging to `family'.

Revision 1.128 / (download) - annotate - [select for diffs], Wed Dec 5 18:07:21 2007 UTC (16 years, 3 months ago) by dyoung
Branch: MAIN
Changes since 1.127: +9 -4 lines
Diff to previous 1.127 (colored)

Add IFNET_FIRST(), IFNET_NEXT(), IFADDR_FIRST(), IFADDR_NEXT(),
IFADDR_EMPTY().

Call the IF{NET,ADDR}_FOREACH() macro arguments __ifp and __ifa
instead of ifp and ifa.

Revision 1.124.8.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:33:26 2007 UTC (16 years, 4 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.124: +17 -1 lines
Diff to previous 1.124 (colored)

sync with HEAD

Revision 1.110.2.5 / (download) - annotate - [select for diffs], Sat Oct 27 11:35:58 2007 UTC (16 years, 4 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.110.2.4: +2 -1 lines
Diff to previous 1.110.2.4 (colored)

sync with head.

Revision 1.123.2.2 / (download) - annotate - [select for diffs], Tue Oct 9 13:44:38 2007 UTC (16 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.123.2.1: +17 -1 lines
Diff to previous 1.123.2.1 (colored) to branchpoint 1.123 (colored) next main 1.124 (colored)

Sync with head.

Revision 1.124.6.2 / (download) - annotate - [select for diffs], Tue Oct 2 18:29:13 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.124.6.1: +2 -1 lines
Diff to previous 1.124.6.1 (colored) to branchpoint 1.124 (colored)

Sync with HEAD.

Revision 1.127 / (download) - annotate - [select for diffs], Thu Sep 13 18:54:57 2007 UTC (16 years, 5 months ago) by gdt
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, vmlocking2-base1, vmlocking-nbase, vmlocking-base, jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: vmlocking2, mjf-devfs
Changes since 1.126: +2 -1 lines
Diff to previous 1.126 (colored)

Add a define for the ifru_space union member.

Copy the entire sockaddr to the buffer to be written to user space,
according to its length, not just the part that fits in struct
sockaddr.

This fixes the 'bad MAC address' problem in dhclient.

Revision 1.124.6.1 / (download) - annotate - [select for diffs], Mon Sep 3 16:48:53 2007 UTC (16 years, 6 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.124: +16 -1 lines
Diff to previous 1.124 (colored)

Sync with HEAD.

Revision 1.110.2.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:42:01 2007 UTC (16 years, 6 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.110.2.3: +27 -11 lines
Diff to previous 1.110.2.3 (colored)

sync with head.

Revision 1.124.2.1 / (download) - annotate - [select for diffs], Mon Sep 3 10:23:07 2007 UTC (16 years, 6 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.124: +16 -1 lines
Diff to previous 1.124 (colored) next main 1.125 (colored)

Sync with HEAD.

Revision 1.126 / (download) - annotate - [select for diffs], Sun Sep 2 00:24:18 2007 UTC (16 years, 6 months ago) by dyoung
Branch: MAIN
CVS Tags: nick-csl-alignment-base5
Changes since 1.125: +3 -1 lines
Diff to previous 1.125 (colored)

Protect userland from ifreq_getaddr() w/ #ifdef _KERNEL.

Revision 1.125 / (download) - annotate - [select for diffs], Fri Aug 31 21:02:15 2007 UTC (16 years, 6 months ago) by dyoung
Branch: MAIN
Changes since 1.124: +14 -1 lines
Diff to previous 1.124 (colored)

Per discussion in 30 May 2007 on tech-net, add accessors for
ifreq->ifr_addr, ifreq_getaddr() and ifreq_setaddr().

Revision 1.123.4.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:10:53 2007 UTC (16 years, 7 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.123: +2 -1 lines
Diff to previous 1.123 (colored) next main 1.124 (colored)

Sync with head.

Revision 1.123.2.1 / (download) - annotate - [select for diffs], Sat Jun 9 23:58:10 2007 UTC (16 years, 8 months ago) by ad
Branch: vmlocking
Changes since 1.123: +2 -1 lines
Diff to previous 1.123 (colored)

Sync with head.

Revision 1.124 / (download) - annotate - [select for diffs], Tue May 29 21:32:29 2007 UTC (16 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: nick-csl-alignment, matt-armv6, jmcneill-pm
Changes since 1.123: +2 -1 lines
Diff to previous 1.123 (colored)

Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.

Revision 1.121.4.2 / (download) - annotate - [select for diffs], Mon Mar 12 05:59:09 2007 UTC (16 years, 11 months ago) by rmind
Branch: yamt-idlelwp
Changes since 1.121.4.1: +11 -11 lines
Diff to previous 1.121.4.1 (colored) to branchpoint 1.121 (colored) next main 1.122 (colored)

Sync with HEAD.

Revision 1.123 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:15 2007 UTC (17 years ago) by christos
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: vmlocking, mjf-ufs-trans
Changes since 1.122: +11 -11 lines
Diff to previous 1.122 (colored)

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

Revision 1.121.4.1 / (download) - annotate - [select for diffs], Tue Feb 27 16:54:39 2007 UTC (17 years ago) by yamt
Branch: yamt-idlelwp
Changes since 1.121: +4 -4 lines
Diff to previous 1.121 (colored)

- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.110.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:11:33 2007 UTC (17 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.110.2.2: +4 -4 lines
Diff to previous 1.110.2.2 (colored)

sync with head.

Revision 1.122 / (download) - annotate - [select for diffs], Sat Feb 17 22:34:08 2007 UTC (17 years ago) by dyoung
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.121: +4 -4 lines
Diff to previous 1.121 (colored)

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.119.2.2 / (download) - annotate - [select for diffs], Fri Jan 12 01:04:11 2007 UTC (17 years, 1 month ago) by ad
Branch: newlock2
Changes since 1.119.2.1: +4 -2 lines
Diff to previous 1.119.2.1 (colored) to branchpoint 1.119 (colored) next main 1.120 (colored)

Sync with head.

Revision 1.110.2.2 / (download) - annotate - [select for diffs], Sat Dec 30 20:50:20 2006 UTC (17 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.110.2.1: +20 -7 lines
Diff to previous 1.110.2.1 (colored)

sync with head.

Revision 1.119.4.1 / (download) - annotate - [select for diffs], Sun Dec 10 07:19:00 2006 UTC (17 years, 2 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.119: +18 -2 lines
Diff to previous 1.119 (colored) next main 1.120 (colored)

sync with head.

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

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

Revision 1.119.2.1 / (download) - annotate - [select for diffs], Sat Nov 18 21:39:29 2006 UTC (17 years, 3 months ago) by ad
Branch: newlock2
Changes since 1.119: +15 -1 lines
Diff to previous 1.119 (colored)

Sync with head.

Revision 1.120 / (download) - annotate - [select for diffs], Mon Nov 13 05:13:40 2006 UTC (17 years, 3 months ago) by dyoung
Branch: MAIN
Changes since 1.119: +15 -1 lines
Diff to previous 1.119 (colored)

Add a source-address selection policy mechanism to the kernel.

Also, add ioctls SIOCGIFADDRPREF/SIOCSIFADDRPREF to get/set preference
numbers for addresses.  Make ifconfig(8) set/display preference
numbers.

To activate source-address selection policies in your kernel, add
'options IPSELSRC' to your kernel configuration.

Miscellaneous changes in support of source-address selection:

        1 Factor out some common code, producing rt_replace_ifa().

        2 Abbreviate a for-loop with TAILQ_FOREACH().

        3 Add the predicates on IPv4 addresses IN_LINKLOCAL() and
          IN_PRIVATE(), that are true for link-local unicast
          (169.254/16) and RFC1918 private addresses, respectively.
          Add the predicate IN_ANY_LOCAL() that is true for link-local
          unicast and multicast.

        4 Add IPv4-specific interface attach/detach routines,
          in_domifattach and in_domifdetach, which build #ifdef
          IPSELSRC.

See in_getifa(9) for a more thorough description of source-address
selection policy.

Revision 1.114.4.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:58:06 2006 UTC (17 years, 5 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.114: +10 -8 lines
Diff to previous 1.114 (colored) next main 1.115 (colored)

sync with head

Revision 1.114.8.4 / (download) - annotate - [select for diffs], Sun Sep 3 15:25:35 2006 UTC (17 years, 6 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.114.8.3: +2 -2 lines
Diff to previous 1.114.8.3 (colored) to branchpoint 1.114 (colored) next main 1.115 (colored)

sync with head.

Revision 1.119 / (download) - annotate - [select for diffs], Wed Aug 30 16:41:08 2006 UTC (17 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2, yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.118: +2 -2 lines
Diff to previous 1.118 (colored)

fully initialize IF_CLONE_INITIALIZER

Revision 1.116.4.1 / (download) - annotate - [select for diffs], Thu Jul 13 17:49:57 2006 UTC (17 years, 7 months ago) by gdamore
Branch: gdamore-uart
Changes since 1.116: +2 -5 lines
Diff to previous 1.116 (colored) next main 1.117 (colored)

Merge from HEAD.

Revision 1.114.8.3 / (download) - annotate - [select for diffs], Mon Jun 26 12:53:38 2006 UTC (17 years, 8 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.114.8.2: +2 -5 lines
Diff to previous 1.114.8.2 (colored) to branchpoint 1.114 (colored)

sync with head.

Revision 1.118 / (download) - annotate - [select for diffs], Sun Jun 25 07:50:00 2006 UTC (17 years, 8 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, yamt-pdpolicy-base6, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.117: +2 -2 lines
Diff to previous 1.117 (colored)

add a comment on if_agrprivate.

Revision 1.117 / (download) - annotate - [select for diffs], Fri Jun 23 19:02:51 2006 UTC (17 years, 8 months ago) by drochner
Branch: MAIN
Changes since 1.116: +1 -4 lines
Diff to previous 1.116 (colored)

remove dependency on "agr" to make "struct ifnet" independant of the
kernel configuration, avoids kernel/userland mismatches, ok by christos

Revision 1.110.2.1 / (download) - annotate - [select for diffs], Wed Jun 21 15:10:27 2006 UTC (17 years, 8 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.110: +83 -70 lines
Diff to previous 1.110 (colored)

sync with head.

Revision 1.114.6.2 / (download) - annotate - [select for diffs], Thu Jun 1 22:38:37 2006 UTC (17 years, 9 months ago) by kardel
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.114.6.1: +9 -2 lines
Diff to previous 1.114.6.1 (colored) to branchpoint 1.114 (colored) next main 1.115 (colored)

Sync with head.

Revision 1.115.2.1 / (download) - annotate - [select for diffs], Wed May 24 15:50:43 2006 UTC (17 years, 9 months ago) by tron
Branch: peter-altq
Changes since 1.115: +9 -2 lines
Diff to previous 1.115 (colored) next main 1.116 (colored)

Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.114.8.2 / (download) - annotate - [select for diffs], Wed May 24 10:58:56 2006 UTC (17 years, 9 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.114.8.1: +9 -2 lines
Diff to previous 1.114.8.1 (colored) to branchpoint 1.114 (colored)

sync with head.

Revision 1.116 / (download) - annotate - [select for diffs], Thu May 18 09:05:51 2006 UTC (17 years, 9 months ago) by liamjfoy
Branch: MAIN
CVS Tags: yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, chap-midi-nbase, chap-midi-base, chap-midi
Branch point for: gdamore-uart
Changes since 1.115: +9 -2 lines
Diff to previous 1.115 (colored)

Integrate Common Address Redundancy Procotol (CARP) from OpenBSD

'pseudo-device	carp'

Thanks to: joerg@ christos@ riz@ and others who tested
Ok: core@

Revision 1.114.6.1 / (download) - annotate - [select for diffs], Sat Apr 22 11:40:06 2006 UTC (17 years, 10 months ago) by simonb
Branch: simonb-timecounters
Changes since 1.114: +1 -3 lines
Diff to previous 1.114 (colored)

Sync with head.

Revision 1.114.10.1 / (download) - annotate - [select for diffs], Wed Apr 19 04:46:10 2006 UTC (17 years, 10 months ago) by elad
Branch: elad-kernelauth
Changes since 1.114: +1 -3 lines
Diff to previous 1.114 (colored) next main 1.115 (colored)

sync with head.

Revision 1.114.8.1 / (download) - annotate - [select for diffs], Sat Apr 1 12:07:42 2006 UTC (17 years, 11 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.114: +1 -3 lines
Diff to previous 1.114 (colored)

sync with head.

Revision 1.115 / (download) - annotate - [select for diffs], Thu Mar 16 15:56:28 2006 UTC (17 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3, peter-altq-base, elad-kernelauth-base
Branch point for: peter-altq
Changes since 1.114: +1 -3 lines
Diff to previous 1.114 (colored)

Remove duplicate and slightly different declaration of ether_sprintf, which
really should be in if_ether.h like all the other ether_ functions.

Revision 1.114 / (download) - annotate - [select for diffs], Sun Dec 11 23:05:24 2005 UTC (18 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-uio_vmspace, yamt-pdpolicy-base2, yamt-pdpolicy-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, elad-kernelauth
Changes since 1.113: +62 -62 lines
Diff to previous 1.113 (colored)

ANSI function decls and application of static.

Revision 1.113 / (download) - annotate - [select for diffs], Sun Dec 11 12:24:51 2005 UTC (18 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.112: +2 -2 lines
Diff to previous 1.112 (colored)

merge ktrace-lwp.

Revision 1.90.2.12 / (download) - annotate - [select for diffs], Sun Dec 11 10:29:19 2005 UTC (18 years, 2 months ago) by christos
Branch: ktrace-lwp
Changes since 1.90.2.11: +7 -7 lines
Diff to previous 1.90.2.11 (colored) next main 1.91 (colored)

Sync with head.

Revision 1.112 / (download) - annotate - [select for diffs], Tue Dec 6 02:56:25 2005 UTC (18 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: ktrace-lwp-base
Changes since 1.111: +7 -7 lines
Diff to previous 1.111 (colored)

make the ALTQ macros statement-line, by wrapping them in do {} while (0)

Revision 1.90.2.11 / (download) - annotate - [select for diffs], Thu Nov 10 14:10:32 2005 UTC (18 years, 3 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.10: +41 -19 lines
Diff to previous 1.90.2.10 (colored)

Sync with HEAD. Here we go again...

Revision 1.111 / (download) - annotate - [select for diffs], Wed Jul 27 06:36:15 2005 UTC (18 years, 7 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr
Changes since 1.110: +10 -2 lines
Diff to previous 1.110 (colored)

Add members ifr_buf, ifr_buflen to ifreq for specifying the location
and size of a userland buffer.  The kernel shall not copyout more
than ifr_buflen bytes to ifr_buf.  For future ioctls that use
ifr_buf and ifr_buflen instead of ifr_data, the kernel can return
a larger struct in the future than when the ioctl is introduced,
without breaking ABI compatibility, provided that the size, order,
and semantics of the fields at the front of the struct does not
change.

Revision 1.110 / (download) - annotate - [select for diffs], Wed Jun 22 06:16:02 2005 UTC (18 years, 8 months ago) by dyoung
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.109: +2 -1 lines
Diff to previous 1.109 (colored)

Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD.  Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]).  Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.

Revision 1.109 / (download) - annotate - [select for diffs], Sun Jun 19 11:34:42 2005 UTC (18 years, 8 months ago) by peter
Branch: MAIN
Changes since 1.108: +6 -6 lines
Diff to previous 1.108 (colored)

Use 'pattr' consistently in the IFQ_* macros.

Revision 1.108 / (download) - annotate - [select for diffs], Mon May 2 15:34:32 2005 UTC (18 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.107: +26 -13 lines
Diff to previous 1.107 (colored)

split IFCAP_CSUM_xxx to IFCAP_CSUM_xxx_Rx and IFCAP_CSUM_xxx_Tx.

Revision 1.99.2.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:29:31 2005 UTC (18 years, 10 months ago) by kent
Branch: kent-audio2
Changes since 1.99: +32 -8 lines
Diff to previous 1.99 (colored) next main 1.100 (colored)

sync with -current

Revision 1.90.2.10 / (download) - annotate - [select for diffs], Fri Apr 1 14:31:34 2005 UTC (18 years, 11 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.9: +23 -2 lines
Diff to previous 1.90.2.9 (colored)

Sync with HEAD.

Revision 1.107 / (download) - annotate - [select for diffs], Thu Mar 31 15:48:13 2005 UTC (18 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.106: +8 -1 lines
Diff to previous 1.106 (colored)

factor out the interface queueing code into two functions. One used by
the non point-to-point interfaces that has one queue, and one used by
the point to point interfaces that has two queues. No functional changes.
XXX: The ALTQ stuff makes the code ugly.
XXX: More cleanup to come

Revision 1.100.2.2 / (download) - annotate - [select for diffs], Sat Mar 26 18:19:20 2005 UTC (18 years, 11 months ago) by yamt
Branch: yamt-km
Changes since 1.100.2.1: +11 -2 lines
Diff to previous 1.100.2.1 (colored) to branchpoint 1.100 (colored) next main 1.101 (colored)

sync with head.

Revision 1.106 / (download) - annotate - [select for diffs], Sun Mar 20 07:47:29 2005 UTC (18 years, 11 months ago) by agc
Branch: MAIN
CVS Tags: yamt-km-base4
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

Fix the spelling of Bill Studenmund's name - noticed from the licences
on the Sony PSP as found in:

	http://www.scei.co.jp/psp-license/pspnet.txt

Revision 1.105 / (download) - annotate - [select for diffs], Sun Mar 20 02:51:33 2005 UTC (18 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.104: +10 -1 lines
Diff to previous 1.104 (colored)

Define IFFBITS and IFCAPBITS here in <net/if.h>.  Taken from ifconfig.

Revision 1.100.2.1 / (download) - annotate - [select for diffs], Sat Mar 19 08:36:31 2005 UTC (18 years, 11 months ago) by yamt
Branch: yamt-km
Changes since 1.100: +11 -5 lines
Diff to previous 1.100 (colored)

sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Mar 18 11:11:50 2005 UTC (18 years, 11 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base3
Changes since 1.103: +6 -1 lines
Diff to previous 1.103 (colored)

add agr(4), a pseudo network device driver for link aggregation.

Revision 1.90.2.9 / (download) - annotate - [select for diffs], Tue Mar 8 13:53:11 2005 UTC (19 years ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.8: +2 -1 lines
Diff to previous 1.90.2.8 (colored)

Sync with HEAD.

Revision 1.103 / (download) - annotate - [select for diffs], Sun Mar 6 00:08:30 2005 UTC (19 years ago) by matt
Branch: MAIN
CVS Tags: 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
Changes since 1.102: +2 -1 lines
Diff to previous 1.102 (colored)

Add beginning of TCP Segment Offload support.

Revision 1.90.2.8 / (download) - annotate - [select for diffs], Fri Mar 4 16:52:56 2005 UTC (19 years ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.7: +5 -5 lines
Diff to previous 1.90.2.7 (colored)

Sync with HEAD.

Hi Perry!

Revision 1.102 / (download) - annotate - [select for diffs], Mon Feb 28 18:44:45 2005 UTC (19 years ago) by jonathan
Branch: MAIN
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored)

Increase default value for IFQ_MAXLEN from 50 to 256.

The value of 50 dates back to 4.3BSD and 10Mbit interfaces.
Gigabit interfaces are 100x faster, and by observation, when heavy
interrupt mitigation is enabled, gigabit interfaces can enqueue 40 packets
or more in a single hardware interrupt.  So IFQ_MAXLEN of 256 is adequate
for at least four gigabit interfaces.

Increasing IFQ_MAXLEN discussed and approved, in priniciple, circa Apr 2004.
The value is sysctl'able, so the default is no longer so critical,
but (imho) best to tune for high-performane systems by default.

Revision 1.101 / (download) - annotate - [select for diffs], Sat Feb 26 22:45:09 2005 UTC (19 years ago) by perry
Branch: MAIN
Changes since 1.100: +4 -4 lines
Diff to previous 1.100 (colored)

nuke trailing whitespace

Revision 1.90.2.7 / (download) - annotate - [select for diffs], Fri Feb 4 11:47:42 2005 UTC (19 years, 1 month ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.6: +5 -3 lines
Diff to previous 1.90.2.6 (colored)

Sync with HEAD.

Revision 1.100 / (download) - annotate - [select for diffs], Mon Jan 24 21:25:09 2005 UTC (19 years, 1 month ago) by matt
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base
Branch point for: yamt-km
Changes since 1.99: +5 -3 lines
Diff to previous 1.99 (colored)

Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them.

Revision 1.90.2.6 / (download) - annotate - [select for diffs], Mon Jan 17 19:32:38 2005 UTC (19 years, 1 month ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.5: +2 -2 lines
Diff to previous 1.90.2.5 (colored)

Sync with HEAD.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Jan 8 03:18:18 2005 UTC (19 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: kent-audio1-beforemerge
Branch point for: kent-audio2
Changes since 1.98: +2 -2 lines
Diff to previous 1.98 (colored)

constify broadcastaddr.

Revision 1.90.2.5 / (download) - annotate - [select for diffs], Sat Dec 18 09:32:50 2004 UTC (19 years, 2 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.4: +3 -5 lines
Diff to previous 1.90.2.4 (colored)

Sync with HEAD.

Revision 1.98 / (download) - annotate - [select for diffs], Sat Dec 4 18:31:43 2004 UTC (19 years, 3 months ago) by peter
Branch: MAIN
CVS Tags: kent-audio1-base, kent-audio1
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored)

Change ifc_destroy to return an int instead of void, so that it
can pass back errors to ifconfig.

Revision 1.97 / (download) - annotate - [select for diffs], Sat Dec 4 16:10:25 2004 UTC (19 years, 3 months ago) by peter
Branch: MAIN
Changes since 1.96: +2 -4 lines
Diff to previous 1.96 (colored)

Convert lo(4) to a clonable device.

This also removes the loif array and changes all code to use the new
lo0ifp pointer which points to the lo0 ifnet structure.

Approved by christos.

Revision 1.90.2.4 / (download) - annotate - [select for diffs], Tue Sep 21 13:36:35 2004 UTC (19 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.3: +2 -2 lines
Diff to previous 1.90.2.3 (colored)

Fix the sync with head I botched.

Revision 1.90.2.3 / (download) - annotate - [select for diffs], Sat Sep 18 14:54:16 2004 UTC (19 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.2: +2 -2 lines
Diff to previous 1.90.2.2 (colored)

Sync with HEAD.

Revision 1.90.2.2 / (download) - annotate - [select for diffs], Tue Aug 3 10:54:11 2004 UTC (19 years, 7 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.90.2.1: +42 -15 lines
Diff to previous 1.90.2.1 (colored)

Sync with HEAD

Revision 1.96 / (download) - annotate - [select for diffs], Wed Apr 21 04:17:28 2004 UTC (19 years, 10 months ago) by matt
Branch: MAIN
Changes since 1.95: +8 -8 lines
Diff to previous 1.95 (colored)

Constify if.c radix.c and route.c (and fix related fallout).

Revision 1.95 / (download) - annotate - [select for diffs], Wed Dec 10 11:46:33 2003 UTC (20 years, 2 months ago) by itojun
Branch: 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
Changes since 1.94: +2 -2 lines
Diff to previous 1.94 (colored)

use if_indexlim (instead of if_index) and ifindex2ifnet[x] != NULL
to check if interface exists, as (1) if_index has different meaning
(2) ifindex2ifnet could become NULL when interface gets destroyed,
since when we have introduced dynamically-created interfaces.  from kame

Revision 1.94 / (download) - annotate - [select for diffs], Fri Nov 28 08:56:48 2003 UTC (20 years, 3 months ago) by keihan
Branch: MAIN
Changes since 1.93: +2 -2 lines
Diff to previous 1.93 (colored)

s/netbsd.org/NetBSD.org/g

Revision 1.93 / (download) - annotate - [select for diffs], Mon Nov 10 20:03:29 2003 UTC (20 years, 3 months ago) by jonathan
Branch: MAIN
Changes since 1.92: +30 -1 lines
Diff to previous 1.92 (colored)

Make per-protocol network input queue stats visible to userland via
sysctl. Add a protocol-independent sysctl handler to show the per-protocol
"struct ifq' statistics. Add IP(v4) specific call to the handler.
Other protocols can show their per-protocol input statistics by
allocating a sysclt node and calling sysctl_ifq() with their own struct ifq *.

As posted to tech-kern plus improvements/cleanup suggested by Andrew Brown.

Revision 1.92 / (download) - annotate - [select for diffs], Thu Aug 7 16:32:49 2003 UTC (20 years, 7 months ago) by agc
Branch: MAIN
Changes since 1.91: +2 -6 lines
Diff to previous 1.91 (colored)

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

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

Revision 1.91 / (download) - annotate - [select for diffs], Thu Jul 3 09:24:19 2003 UTC (20 years, 8 months ago) by ragge
Branch: MAIN
Changes since 1.90: +3 -1 lines
Diff to previous 1.90 (colored)

Make IFQ_MAXLEN possible to set as an config-file option.

Revision 1.90.2.1 / (download) - annotate - [select for diffs], Wed Jul 2 15:26:56 2003 UTC (20 years, 8 months ago) by darrenr
Branch: ktrace-lwp
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

Apply the aborted ktrace-lwp changes to a specific branch.  This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it.  This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.

Revision 1.90 / (download) - annotate - [select for diffs], Sun Jun 29 22:31:51 2003 UTC (20 years, 8 months ago) by fvdl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.89: +1 -1 lines
Diff to previous 1.89 (colored)

Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.

Revision 1.89 / (download) - annotate - [select for diffs], Sat Jun 28 14:22:07 2003 UTC (20 years, 8 months ago) by darrenr
Branch: MAIN
Changes since 1.88: +2 -2 lines
Diff to previous 1.88 (colored)

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V

Revision 1.88 / (download) - annotate - [select for diffs], Wed Apr 30 18:50:26 2003 UTC (20 years, 10 months ago) by bjh21
Branch: MAIN
Changes since 1.87: +9 -7 lines
Diff to previous 1.87 (colored)

Expose IF_NAMESIZE for POSIX and X/Open applications.

Revision 1.87 / (download) - annotate - [select for diffs], Mon Apr 28 23:16:25 2003 UTC (20 years, 10 months ago) by bjh21
Branch: MAIN
Changes since 1.86: +4 -3 lines
Diff to previous 1.86 (colored)

Add a new feature-test macro, _NETBSD_SOURCE.  If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.

Revision 1.86 / (download) - annotate - [select for diffs], Wed Mar 5 22:56:46 2003 UTC (21 years ago) by christos
Branch: MAIN
Changes since 1.85: +3 -1 lines
Diff to previous 1.85 (colored)

Fix the fallout from potr malloc changes

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

Add MBUFTRACE kernel option.
Do a little mbuf rework while here.  Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *).  These are not performance critical and making them
call m_get saves considerable space.  Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.

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

Add extensible malloc types, adapted from FreeBSD.  This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.

Revision 1.65.2.9 / (download) - annotate - [select for diffs], Mon Nov 11 22:14:58 2002 UTC (21 years, 3 months ago) by nathanw
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.65.2.8: +12 -12 lines
Diff to previous 1.65.2.8 (colored) next main 1.66 (colored)

Catch up to -current

Revision 1.83 / (download) - annotate - [select for diffs], Sat Nov 2 07:26:54 2002 UTC (21 years, 4 months ago) by perry
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.82: +13 -13 lines
Diff to previous 1.82 (colored)

/*CONTCOND*/ while (0)'ed macros

Revision 1.75.6.1 / (download) - annotate - [select for diffs], Fri Nov 1 10:56:03 2002 UTC (21 years, 4 months ago) by tron
Branch: netbsd-1-6
CVS Tags: 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
Changes since 1.75: +6 -1 lines
Diff to previous 1.75 (colored) next main 1.76 (colored)

Pull up revision 1.76 (requested by martin in ticket #32):
Add SIOCGIFDATA and SIOCZIFDATA ioctl's to get interface data.  (the Z
variant also zeroes the counters after copying them).  In ifunit, add
support for dealing all numeric ifname by treating them as an ifindex
which is used to look up the interface.

Revision 1.73.2.3 / (download) - annotate - [select for diffs], Fri Sep 6 08:48:50 2002 UTC (21 years, 6 months ago) by jdolecek
Branch: kqueue
Changes since 1.73.2.2: +3 -17 lines
Diff to previous 1.73.2.2 (colored) to branchpoint 1.73 (colored) next main 1.74 (colored)

sync kqueue branch with HEAD

Revision 1.75.4.4 / (download) - annotate - [select for diffs], Thu Aug 29 00:56:41 2002 UTC (21 years, 6 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.75.4.3: +3 -2 lines
Diff to previous 1.75.4.3 (colored) to branchpoint 1.75 (colored) next main 1.76 (colored)

catch up with -current.

Revision 1.65.2.8 / (download) - annotate - [select for diffs], Tue Aug 27 23:47:50 2002 UTC (21 years, 6 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.65.2.7: +1 -1 lines
Diff to previous 1.65.2.7 (colored)

Catch up to -current.

Revision 1.82 / (download) - annotate - [select for diffs], Mon Aug 26 01:36:37 2002 UTC (21 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gehenna-devsw-base
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored)

Fix signed/unsigned comparison warnings from GCC 3.3.

Revision 1.65.2.7 / (download) - annotate - [select for diffs], Tue Aug 13 02:20:12 2002 UTC (21 years, 6 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.65.2.6: +1 -0 lines
Diff to previous 1.65.2.6 (colored)

Catch up to -current.

Revision 1.81 / (download) - annotate - [select for diffs], Fri Aug 9 22:43:15 2002 UTC (21 years, 7 months ago) by soren
Branch: MAIN
Changes since 1.80: +2 -1 lines
Diff to previous 1.80 (colored)

<net/if.h> needs <sys/socket.h> for struct sockaddr.
PR kern/3377 from der Mouse.

Revision 1.65.2.6 / (download) - annotate - [select for diffs], Thu Aug 1 02:46:37 2002 UTC (21 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.65.2.5: +1 -16 lines
Diff to previous 1.65.2.5 (colored)

Catch up to -current.

Revision 1.75.4.3 / (download) - annotate - [select for diffs], Mon Jul 15 10:36:47 2002 UTC (21 years, 7 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.75.4.2: +1 -16 lines
Diff to previous 1.75.4.2 (colored) to branchpoint 1.75 (colored)

catch up with -current.

Revision 1.80 / (download) - annotate - [select for diffs], Sun Jun 23 23:34:08 2002 UTC (21 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.79: +1 -16 lines
Diff to previous 1.79 (colored)

g/c last bit of old ipv6 prefix management.

Revision 1.73.2.2 / (download) - annotate - [select for diffs], Sun Jun 23 17:50:21 2002 UTC (21 years, 8 months ago) by jdolecek
Branch: kqueue
Changes since 1.73.2.1: +12 -3 lines
Diff to previous 1.73.2.1 (colored) to branchpoint 1.73 (colored)

catch up with -current on kqueue branch

Revision 1.75.4.2 / (download) - annotate - [select for diffs], Thu Jun 20 15:52:06 2002 UTC (21 years, 8 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.75.4.1: +2 -2 lines
Diff to previous 1.75.4.1 (colored) to branchpoint 1.75 (colored)

catch up with -current.

Revision 1.65.2.5 / (download) - annotate - [select for diffs], Thu Jun 20 03:48:09 2002 UTC (21 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.65.2.4: +11 -2 lines
Diff to previous 1.65.2.4 (colored)

Catch up to -current.

Revision 1.79 / (download) - annotate - [select for diffs], Tue Jun 11 11:03:55 2002 UTC (21 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

s/splimp/splnet/ in comment

Revision 1.75.4.1 / (download) - annotate - [select for diffs], Thu May 30 13:52:24 2002 UTC (21 years, 9 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.75: +10 -1 lines
Diff to previous 1.75 (colored)

Catch up with -current.

Revision 1.78 / (download) - annotate - [select for diffs], Mon May 27 13:46:45 2002 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.77: +3 -1 lines
Diff to previous 1.77 (colored)

re-scan all ifnet after domaininit() for if_afdata initialization.

Revision 1.77 / (download) - annotate - [select for diffs], Mon May 27 02:53:49 2002 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.76: +3 -1 lines
Diff to previous 1.76 (colored)

framework to add af-dependent data structure to struct ifnet.
as discussed at bsd-api-discuss.  sync w/kame

Revision 1.76 / (download) - annotate - [select for diffs], Thu May 23 21:34:40 2002 UTC (21 years, 9 months ago) by matt
Branch: MAIN
Changes since 1.75: +6 -1 lines
Diff to previous 1.75 (colored)

Add SIOCGIFDATA and SIOCZIFDATA ioctl's to get interface data.  (the Z
variant also zeroes the counters after copying them).  In ifunit, add
support for dealing all numeric ifname by treating them as an ifindex
which is used to look up the interface.

Revision 1.65.2.4 / (download) - annotate - [select for diffs], Mon Apr 1 07:48:19 2002 UTC (21 years, 11 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.65.2.3: +2 -2 lines
Diff to previous 1.65.2.3 (colored)

Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.75 / (download) - annotate - [select for diffs], Sun Mar 17 10:21:42 2002 UTC (21 years, 11 months ago) by simonb
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, eeh-devprop-base, eeh-devprop
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

Make the 'ifnet' variable an extern and declare it in if.c.

Revision 1.73.2.1 / (download) - annotate - [select for diffs], Thu Jan 10 20:02:00 2002 UTC (22 years, 1 month ago) by thorpej
Branch: kqueue
Changes since 1.73: +5 -2 lines
Diff to previous 1.73 (colored)

Sync kqueue branch with -current.

Revision 1.73.4.1 / (download) - annotate - [select for diffs], Mon Oct 1 12:47:33 2001 UTC (22 years, 5 months ago) by fvdl
Branch: thorpej-devvp
Changes since 1.73: +5 -2 lines
Diff to previous 1.73 (colored) next main 1.74 (colored)

Catch up with -current.

Revision 1.65.2.3 / (download) - annotate - [select for diffs], Fri Sep 21 22:36:44 2001 UTC (22 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.65.2.2: +5 -2 lines
Diff to previous 1.65.2.2 (colored)

Catch up to -current.

Revision 1.74 / (download) - annotate - [select for diffs], Mon Sep 17 17:26:59 2001 UTC (22 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base3, thorpej-devvp-base2, newlock-base, newlock, ifpoll-base
Changes since 1.73: +5 -2 lines
Diff to previous 1.73 (colored)

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.65.2.2 / (download) - annotate - [select for diffs], Thu Jun 21 20:07:57 2001 UTC (22 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.65.2.1: +43 -20 lines
Diff to previous 1.65.2.1 (colored)

Catch up to -current.

Revision 1.73 / (download) - annotate - [select for diffs], Thu Jun 14 06:37:34 2001 UTC (22 years, 8 months ago) by itojun
Branch: MAIN
CVS Tags: thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp, kqueue
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored)

fix comment on ifi_lastchange, for 1.4 if_data

Revision 1.72 / (download) - annotate - [select for diffs], Thu Jun 14 05:50:02 2001 UTC (22 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

update comment on if_lastchange

Revision 1.71 / (download) - annotate - [select for diffs], Mon Jun 11 01:50:57 2001 UTC (22 years, 8 months ago) by wiz
Branch: MAIN
Changes since 1.70: +4 -4 lines
Diff to previous 1.70 (colored)

Fix various misspellings of compatible/compatibility.

Revision 1.70 / (download) - annotate - [select for diffs], Sat Jun 2 16:17:08 2001 UTC (22 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.69: +35 -14 lines
Diff to previous 1.69 (colored)

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

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

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

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

Revision 1.69 / (download) - annotate - [select for diffs], Wed May 30 12:04:53 2001 UTC (22 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.68: +2 -2 lines
Diff to previous 1.68 (colored)

use _KERNEL_OPT

Revision 1.40.2.5 / (download) - annotate - [select for diffs], Sat Apr 21 17:46:37 2001 UTC (22 years, 10 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.40.2.4: +4 -4 lines
Diff to previous 1.40.2.4 (colored) next main 1.41 (colored)

Sync with HEAD

Revision 1.68 / (download) - annotate - [select for diffs], Tue Apr 10 22:58:55 2001 UTC (22 years, 10 months ago) by enami
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored)

fix possible typo in comment.

Revision 1.67 / (download) - annotate - [select for diffs], Tue Apr 10 21:45:39 2001 UTC (22 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.66: +3 -1 lines
Diff to previous 1.66 (colored)

Add a PFIL_HOOKS filtering point to every network interface.

Revision 1.65.2.1 / (download) - annotate - [select for diffs], Mon Apr 9 01:58:11 2001 UTC (22 years, 11 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.65: +2 -4 lines
Diff to previous 1.65 (colored)

Catch up with -current.

Revision 1.66 / (download) - annotate - [select for diffs], Sat Apr 7 04:24:31 2001 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.65: +2 -4 lines
Diff to previous 1.65 (colored)

ether_*() functions belong in if_ether.h, not if.h.

Revision 1.40.2.4 / (download) - annotate - [select for diffs], Sun Feb 11 19:17:08 2001 UTC (23 years ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.40.2.3: +2 -2 lines
Diff to previous 1.40.2.3 (colored)

Sync with HEAD.

Revision 1.40.2.3 / (download) - annotate - [select for diffs], Thu Jan 18 09:23:49 2001 UTC (23 years, 1 month ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.40.2.2: +6 -3 lines
Diff to previous 1.40.2.2 (colored)

Sync with head (for UBC+NFS fixes, mostly).

Revision 1.65 / (download) - annotate - [select for diffs], Wed Jan 17 15:07:07 2001 UTC (23 years, 1 month ago) by itojun
Branch: MAIN
Branch point for: nathanw_sa
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

move forward decl of rt_addrinfo upwards.

Revision 1.64 / (download) - annotate - [select for diffs], Wed Jan 17 04:05:42 2001 UTC (23 years, 1 month ago) by itojun
Branch: MAIN
Changes since 1.63: +5 -4 lines
Diff to previous 1.63 (colored)

pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2 (UCB copyrighted).

have sys/net/route.c:rtrequest1(), which takes rt_addrinfo * as the argument.
pass rt_addrinfo all the way down to rtrequest, and ifa->ifa_rtrequest.
3rd arg of ifa->ifa_rtrequest is now rt_addrinfo * instead of sockaddr *
(almost noone is using it anyways).

benefit: the follwoing command now works.  previously we need two route(8)
invocations, "add" then "change".
# route add -inet6 default ::1 -ifp gif0

remove unsafe typecast in rtrequest(), from rtentry * to sockaddr *.  it was
introduced by 4.3BSD-reno and never corrected.

XXX is eon_rtrequest() change correct regarding to 3rd arg?
eon_rtrequest() and rtrequest() were incorrect since 4.3BSD-reno,
so i do not have correct answer in the source code.
someone with more clue about netiso-over-ip, please help.

Revision 1.63 / (download) - annotate - [select for diffs], Wed Jan 17 00:30:50 2001 UTC (23 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.62: +3 -1 lines
Diff to previous 1.62 (colored)

Fix a rather annoying problem where the sockaddr_dl which holds
the link level name for the interface (ifp->if_sadl) is allocated
before ifp->if_addrlen is initialized, which could lead to allocating
too little space for the link level address.

Do this by splitting allocation of the link level name out of
if_attach() and into if_alloc_sadl(), which is normally called
by functions like ether_ifattach().  Network interfaces which
don't have a link-specific attach routine must call if_alloc_sadl()
themselves (example: gif).

Link level names are freed by if_free_sadl(), which can be called
from e.g. ether_ifdetach().  Drivers never need call if_free_sadl()
themselves as if_detach() will do it if it is not already done.

While here, add the ability to pass an AF_LINK address to
SIOCSIFADDR in ether_ioctl() (this is what caused me to notice
the problem that the above fixes).

Revision 1.40.2.2 / (download) - annotate - [select for diffs], Fri Jan 5 17:36:49 2001 UTC (23 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.40.2.1: +137 -9 lines
Diff to previous 1.40.2.1 (colored)

Sync with HEAD

Revision 1.50.4.1 / (download) - annotate - [select for diffs], Sun Dec 31 17:57:43 2000 UTC (23 years, 2 months ago) by jhawk
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001
Changes since 1.50: +39 -8 lines
Diff to previous 1.50 (colored) next main 1.51 (colored)

Pull up revision 1.51, 1.53 (requested by bouyer):
  Support cloning of network pseudo-interfaces.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Dec 23 19:00:18 2000 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

Fix a silly bug in the ALTQ version of IFQ_DEQUEUE().

Revision 1.61 / (download) - annotate - [select for diffs], Mon Dec 18 21:03:34 2000 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.60: +3 -1 lines
Diff to previous 1.60 (colored)

Add an "ifr_dlt" alias for the union in struct ifreq.

Revision 1.60 / (download) - annotate - [select for diffs], Mon Dec 18 20:58:41 2000 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.59: +2 -1 lines
Diff to previous 1.59 (colored)

Always pull in DLT_* constants.

Revision 1.59 / (download) - annotate - [select for diffs], Mon Dec 18 19:25:57 2000 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.58: +2 -1 lines
Diff to previous 1.58 (colored)

Add a if_dlt member, used so that userland can query the DLT_* of an
interface without having to first attach it to a bpfdesc.

Revision 1.58 / (download) - annotate - [select for diffs], Mon Dec 18 18:54:47 2000 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.57: +9 -8 lines
Diff to previous 1.57 (colored)

Commit to the ALTQ glue.

Revision 1.57 / (download) - annotate - [select for diffs], Thu Dec 14 00:19:42 2000 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.56: +9 -6 lines
Diff to previous 1.56 (colored)

Fix braino in IF_PURGE().

Revision 1.56 / (download) - annotate - [select for diffs], Thu Dec 14 00:07:35 2000 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.55: +12 -2 lines
Diff to previous 1.55 (colored)

Oops, forgot IFQ_POLL() in the ALTQ case.

Revision 1.55 / (download) - annotate - [select for diffs], Wed Dec 13 22:05:12 2000 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.54: +118 -8 lines
Diff to previous 1.54 (colored)

First step at integrating ALTQ -- IFQ_*() glue macros that select
old-style queueing or ALTQ based on a compile time option.

Revision 1.40.2.1 / (download) - annotate - [select for diffs], Mon Nov 20 18:09:57 2000 UTC (23 years, 3 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.40: +219 -23 lines
Diff to previous 1.40 (colored)

Update thorpej_scsipi to -current as of a month ago

Revision 1.54 / (download) - annotate - [select for diffs], Wed Oct 11 16:52:34 2000 UTC (23 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.53: +6 -3 lines
Diff to previous 1.53 (colored)

Change the if_reset vector to if_init, and add an if_stop.  if_stop
also takes an argument indicating whether or not the interface should
also be disabled (i.e. power removed, resources freed, etc.)

Revision 1.53 / (download) - annotate - [select for diffs], Thu Jul 20 18:40:27 2000 UTC (23 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.52: +17 -8 lines
Diff to previous 1.52 (colored)

Add a SIOCGIFCLONERS ioctl, which fetches a list of network
interface cloners from the kernel.

Revision 1.52 / (download) - annotate - [select for diffs], Tue Jul 4 19:09:17 2000 UTC (23 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

Don't allow IFF_PROMISC to be changed directly by userspace.  It
interferes with the reference counting done by ifpromisc(), and is
essentially impossible to get the semantics correct if we allow this
flag to be directly toggled.

No programs should really be affected by this; IFF_PROMISC is basically
useless without bpf, anyway, and bpf still provides a way to set
promiscuous mode on an interface (which uses ifpromisc()).

Revision 1.51 / (download) - annotate - [select for diffs], Sun Jul 2 00:20:49 2000 UTC (23 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.50: +23 -1 lines
Diff to previous 1.50 (colored)

Add the notion of "cloning" of network pseudo-interface (e.g. `gif').
This allows them to be created and destroyed on the fly via ifconfig(8),
rather than specifying the count in the kernel configuration file.

Revision 1.50 / (download) - annotate - [select for diffs], Mon May 15 16:59:37 2000 UTC (23 years, 9 months ago) by itojun
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

backout previous (packed attribute to struct ifreq)

Revision 1.49 / (download) - annotate - [select for diffs], Mon May 15 16:45:50 2000 UTC (23 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

add packed attribute to struct ifreq.  this should avoid unaligned access
while parsing SIOCGIFCONF, on alignment-picky archs.

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Thu May 11 09:25:45 2000 UTC (23 years, 9 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003
Changes since 1.35: +9 -1 lines
Diff to previous 1.35 (colored) next main 1.36 (colored)

Pull up revision 1.46 (partial, via patch, requested by jhawk):
  Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Mar 29 03:27:59 2000 UTC (23 years, 11 months ago) by simonb
Branch: MAIN
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored)

Extern the declarations of ifindex2ifnet and if_index.

Revision 1.47 / (download) - annotate - [select for diffs], Wed Mar 22 11:34:15 2000 UTC (23 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.46: +1 -2 lines
Diff to previous 1.46 (colored)

remove if_withname, which was merged in by mistake during KAME merge.

Revision 1.46 / (download) - annotate - [select for diffs], Mon Mar 6 20:49:00 2000 UTC (24 years ago) by thorpej
Branch: MAIN
Changes since 1.45: +35 -3 lines
Diff to previous 1.45 (colored)

- Add link status to if_data, so that routing daemons and other interested
  parties can easily know the state of a link.
- Define an interface announcement message for the routing socket so that
  routing daemons and other interested parties know when an interface
  is attached/detached.

Revision 1.45 / (download) - annotate - [select for diffs], Mon Mar 6 18:55:10 2000 UTC (24 years ago) by kleink
Branch: MAIN
Changes since 1.44: +5 -5 lines
Diff to previous 1.44 (colored)

Make pre-1.5 compatibility structures being defined conditional on _KERNEL
as well.

Revision 1.44 / (download) - annotate - [select for diffs], Tue Feb 1 22:52:05 2000 UTC (24 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.43: +94 -7 lines
Diff to previous 1.43 (colored)

First-draft if_detach() implementation, originally from Bill Studnemund,
although this version has been changed somewhat:
- reference counting on ifaddrs isn't as complete as Bill's original
  work was.  This is hard to get right, and we should attack one
  protocol at a time.
- This doesn't do reference counting or dynamic allocation of ifnets yet.
- This version introduces a new PRU -- PRU_PURGEADDR, which is used to
  purge an ifaddr from a protocol.  The old method Bill used didn't work
  on all protocols, and it only worked on some because it was Very Lucky.

This mostly works ... i.e. works for my USB Ethernet, except for a dangling
ifaddr reference left by the IPv6 code; have not yet tracked this down.

Revision 1.40.6.1 / (download) - annotate - [select for diffs], Mon Dec 27 18:36:07 1999 UTC (24 years, 2 months ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.40: +48 -4 lines
Diff to previous 1.40 (colored) next main 1.41 (colored)

Pull up to last week's -current.

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

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

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

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

Revision 1.35.6.2 / (download) - annotate - [select for diffs], Tue Nov 30 13:34:59 1999 UTC (24 years, 3 months ago) by itojun
Branch: kame
CVS Tags: kame_141_19991130
Changes since 1.35.6.1: +16 -1 lines
Diff to previous 1.35.6.1 (colored) to branchpoint 1.35 (colored) next main 1.36 (colored)

bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code).  Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.

Revision 1.42 / (download) - annotate - [select for diffs], Fri Nov 19 10:41:42 1999 UTC (24 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.41: +44 -1 lines
Diff to previous 1.41 (colored)

Update protocoles and interfaces stats counters to 64bit.
RTM_IFINFO is now 0xf, 0xe is RTM_OIFINFO which returns the old (if_msghdr14)
struct with 32bit counters (binary compat, conditioned on COMPAT_14).
Same for sysctl: node 3 is renamed NET_RT_OIFLIST, NET_RT_IFLIST is now node 4.
Change rt_msg1() to add an mbuf to the mbuf chain instead of just panic()
when the message is larger than MHLEN.

Revision 1.40.4.1 / (download) - annotate - [select for diffs], Mon Nov 15 00:42:11 1999 UTC (24 years, 3 months ago) by fvdl
Branch: fvdl-softdep
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored) next main 1.41 (colored)

Sync with -current

Revision 1.41 / (download) - annotate - [select for diffs], Tue Oct 26 22:32:45 1999 UTC (24 years, 4 months ago) by wrstuden
Branch: MAIN
CVS Tags: fvdl-softdep-base, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)

Up the size of the ifa_flags and ifa_refcnt from shorts to ints. Now will
deal correctly with more than 32767 routes out an interface.

Should close PR 7148 regarding problems when ifs_refcnt overflows.

Bump kernel version from 1.4L to 1.4M.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Sep 29 22:42:02 1999 UTC (24 years, 5 months ago) by thorpej
Branch: MAIN
Branch point for: wrstuden-devbsize, thorpej_scsipi, fvdl-softdep
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

const poison ifunit().

Revision 1.39 / (download) - annotate - [select for diffs], Tue Sep 21 22:16:24 1999 UTC (24 years, 5 months ago) by matt
Branch: MAIN
Changes since 1.38: +3 -1 lines
Diff to previous 1.38 (colored)

Add a ifru_value (unsigned int) as a generic value.

Revision 1.35.4.3 / (download) - annotate - [select for diffs], Mon Aug 2 22:32:28 1999 UTC (24 years, 7 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.35.4.2: +9 -4 lines
Diff to previous 1.35.4.2 (colored) to branchpoint 1.35 (colored) next main 1.36 (colored)

Update from trunk.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Jul 3 13:52:29 1999 UTC (24 years, 8 months ago) by kleink
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.37: +9 -4 lines
Diff to previous 1.37 (colored)

Add namespace protection, using XNS5.2 D2.0 as a reference (which effectively
boils down to not making anything but the if_nameindex(3) interfaces available
to _XOPEN_SOURCE).

Revision 1.35.4.2 / (download) - annotate - [select for diffs], Thu Jul 1 23:45:18 1999 UTC (24 years, 8 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.35.4.1: +46 -1 lines
Diff to previous 1.35.4.1 (colored) to branchpoint 1.35 (colored)

Sync w/ -current.

Revision 1.37 / (download) - annotate - [select for diffs], Thu Jul 1 08:12:48 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.36: +46 -1 lines
Diff to previous 1.36 (colored)

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

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

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

Revision 1.35.6.1 / (download) - annotate - [select for diffs], Mon Jun 28 06:36:55 1999 UTC (24 years, 8 months ago) by itojun
Branch: kame
CVS Tags: kame_14_19990705, kame_14_19990628
Changes since 1.35: +46 -1 lines
Diff to previous 1.35 (colored)

KAME/NetBSD 1.4 SNAP kit, dated 19990628.

NOTE: this branch (kame) is used just for refernce.  this may not compile
due to multiple reasons.

Revision 1.35.4.1 / (download) - annotate - [select for diffs], Mon Jun 21 01:27:32 1999 UTC (24 years, 8 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.35: +3 -4 lines
Diff to previous 1.35 (colored)

Sync w/ -current.

Revision 1.36 / (download) - annotate - [select for diffs], Tue May 18 23:57:19 1999 UTC (24 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.35: +3 -4 lines
Diff to previous 1.35 (colored)

Rework layer 2 protocol input routines.  Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m).  The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary.  Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Mar 27 01:24:49 1999 UTC (24 years, 11 months ago) by aidan
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001
Branch point for: netbsd-1-4, kame, chs-ubc2
Changes since 1.34: +11 -1 lines
Diff to previous 1.34 (colored)

Added per-addr input/output statistics.  Currently just support netatalk
and netinet, currently only tested under netinet.

Disabled by default, enabled by compiling the kernel with option
IFA_STATS.  Enabling this feature seems to make the ip_output function
take 13% longer than before, which should be OK for people that need
this feature.

Revision 1.34 / (download) - annotate - [select for diffs], Wed Mar 10 21:05:08 1999 UTC (25 years ago) by thorpej
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

Const poison ether_ifattach().

Revision 1.33 / (download) - annotate - [select for diffs], Wed Mar 10 03:28:50 1999 UTC (25 years ago) by thorpej
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Const poison ether_sprintf().

Revision 1.32.6.1 / (download) - annotate - [select for diffs], Fri Dec 11 04:53:04 1998 UTC (25 years, 2 months ago) by kenh
Branch: kenh-if-detach
Changes since 1.32: +31 -4 lines
Diff to previous 1.32 (colored) next main 1.33 (colored)

The beginnings of interface detach support.  Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.

Revision 1.32 / (download) - annotate - [select for diffs], Fri May 22 17:47:22 1998 UTC (25 years, 9 months ago) by matt
Branch: MAIN
CVS Tags: kenh-if-detach-base, eeh-paddr_t-base, eeh-paddr_t, chs-ubc-base, chs-ubc
Branch point for: kenh-if-detach
Changes since 1.31: +3 -1 lines
Diff to previous 1.31 (colored)

Add an if_drain to the ifnet structure (call when the system is low
on mbufs).  Add code to m_reclaim to call if_drain in each ifnet
that has one set.  Remove register from declarations.

Revision 1.31 / (download) - annotate - [select for diffs], Thu May 14 00:04:58 1998 UTC (25 years, 9 months ago) by kml
Branch: MAIN
Changes since 1.30: +9 -1 lines
Diff to previous 1.30 (colored)

Driver for Essential Communications' RoadRunner HIPPI (800 Mb/sec network)
card.  With some modification, this could probably also work for their
Gigabit Ethernet card based on the same chipset...

Revision 1.30 / (download) - annotate - [select for diffs], Sun Mar 1 02:25:04 1998 UTC (26 years ago) by fvdl
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

Merge with Lite2 + local changes

Revision 1.1.1.3 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 1 02:13:23 1998 UTC (26 years ago) by fvdl
Branch: WFJ-920714, CSRG
CVS Tags: lite-2
Changes since 1.1.1.2: +4 -4 lines
Diff to previous 1.1.1.2 (colored)

Import 4.4BSD-Lite2

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 1 02:10:06 1998 UTC (26 years ago) by fvdl
Branch: WFJ-920714, CSRG
CVS Tags: lite-1, date-03-may-96
Changes since 1.1.1.1: +168 -59 lines
Diff to previous 1.1.1.1 (colored)

Import 4.4BSD-Lite for reference

Revision 1.28.4.1 / (download) - annotate - [select for diffs], Tue Oct 14 10:29:05 1997 UTC (26 years, 4 months ago) by thorpej
Branch: marc-pcmcia
Changes since 1.28: +2 -1 lines
Diff to previous 1.28 (colored) next main 1.29 (colored)

Update marc-pcmcia branch from trunk.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Oct 2 19:41:57 1997 UTC (26 years, 5 months ago) by is
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, marc-pcmcia-base
Changes since 1.28: +2 -1 lines
Diff to previous 1.28 (colored)

Reimplement a test for broadcast addresses advertized, which was left out
when rewriting the ARP system.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Apr 8 21:29:26 1997 UTC (26 years, 11 months ago) by chuck
Branch: MAIN
CVS Tags: thorpej-signal-base, thorpej-signal, marc-pcmcia-bp, bouyer-scsipi
Branch point for: marc-pcmcia
Changes since 1.27: +5 -1 lines
Diff to previous 1.27 (colored)

prevent multiple inclusions

Revision 1.27 / (download) - annotate - [select for diffs], Mon Mar 17 02:55:14 1997 UTC (26 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.26: +13 -1 lines
Diff to previous 1.26 (colored)

BSD/OS-style network interface media selection, implemented by
Jonathan Stone and myself.  Many thanks to Matt Thomas for providing
the information necessary to implement this interface, and for helping
to shake out the bugs.

Revision 1.26 / (download) - annotate - [select for diffs], Sat Mar 15 18:12:21 1997 UTC (26 years, 11 months ago) by is
Branch: MAIN
Changes since 1.25: +3 -2 lines
Diff to previous 1.25 (colored)

New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.

Revision 1.25.2.1 / (download) - annotate - [select for diffs], Fri Feb 7 18:06:55 1997 UTC (27 years, 1 month ago) by is
Branch: is-newarp
Changes since 1.25: +3 -2 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

Snapshot of new ARP code.

Our old ARP code was hardwired for 6-byte length medium
addresses, while the protocol is designed for any size.

This snapshot contains a first hack at getting rid of
Ethernet specific data structures. The ep driver is updated
(and tested on the PCI bus), the iy and fpa drivers have been
updated, but not real life tested yet.

If you want to test this with other drivers, you have to update
them first yourself, and probably tag the relevant directories.
Better contact me if you want to do this.

Revision 1.24.2.1 / (download) - annotate - [select for diffs], Sat Jan 18 04:32:26 1997 UTC (27 years, 1 month ago) by thorpej
Branch: thorpej-setroot
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored) next main 1.25 (colored)

Update from trunk.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jan 15 18:22:35 1997 UTC (27 years, 1 month ago) by gwr
Branch: MAIN
CVS Tags: mrg-vm-swap, is-newarp-before-merge, is-newarp-base
Branch point for: is-newarp
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

fix alignment again for m68k

Revision 1.24 / (download) - annotate - [select for diffs], Thu Jun 13 21:48:34 1996 UTC (27 years, 8 months ago) by cgd
Branch: MAIN
Branch point for: thorpej-setroot
Changes since 1.23: +3 -1 lines
Diff to previous 1.23 (colored)

add an ifru_mtu member to the union in 'struct ifreq', and add a
#define so that ifr_mtu accesses that.  MTU shouldn't be overloaded
with ifr_metric, if only for clarity.  Adding an MTU field to the
union hurts nothing (in fact, does not actually _change_ generated
code), and does improve clarity.

Revision 1.23 / (download) - annotate - [select for diffs], Tue May 7 02:40:27 1996 UTC (27 years, 10 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2
Changes since 1.22: +11 -6 lines
Diff to previous 1.22 (colored)

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit.  Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Feb 26 23:16:49 1996 UTC (28 years ago) by mrg
Branch: MAIN
Changes since 1.21: +2 -1 lines
Diff to previous 1.21 (colored)

two more local addr changes, all done differently now (idea from charles)

Revision 1.21 / (download) - annotate - [select for diffs], Sat Feb 17 12:32:50 1996 UTC (28 years ago) by pk
Branch: MAIN
Changes since 1.20: +3 -2 lines
Diff to previous 1.20 (colored)

struct ifaliasreq: adapt nomenclature to protocol specific counterparts, ie.
swap `ifra_broadaddr' and `ifra_dstaddr'.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Feb 13 22:00:12 1996 UTC (28 years ago) by christos
Branch: MAIN
Changes since 1.19: +3 -2 lines
Diff to previous 1.19 (colored)

Net prototypes

Revision 1.19 / (download) - annotate - [select for diffs], Mon Jun 19 21:57:28 1995 UTC (28 years, 8 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.18: +5 -3 lines
Diff to previous 1.18 (colored)

oops; export that head definition to non-kernel code.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Jun 19 21:41:37 1995 UTC (28 years, 8 months ago) by cgd
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

define a type for the ifnet queue's head.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Jun 12 00:46:50 1995 UTC (28 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.16: +7 -5 lines
Diff to previous 1.16 (colored)

Various cleanup, including:
* Convert several data structures to use queue.h.
* Split in_pcbnotify() into two parts; one for notifying a specific PCB, and
one for notifying all PCBs for a particular foreign address.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Apr 7 22:20:24 1995 UTC (28 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

if_start and if_watchdog should return void.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Mar 26 20:30:12 1995 UTC (28 years, 11 months ago) by jtc
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

KERNEL -> _KERNEL

Revision 1.14 / (download) - annotate - [select for diffs], Wed Mar 8 02:56:49 1995 UTC (29 years ago) by cgd
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

fixed sized types, where appropriate.  when casting pointers to
integers to do math on them, cast to long.  ioctl commands are
u_longs.

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

be more careful with types, also pull in headers where necessary.

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

fix pr 528; don't define struct if_data inside another structure.

Revision 1.10.2.1 / (download) - annotate - [select for diffs], Sun Aug 14 09:01:03 1994 UTC (29 years, 6 months ago) by mycroft
Branch: netbsd-1-0
CVS Tags: netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0
Changes since 1.10: +1 -4 lines
Diff to previous 1.10 (colored) next main 1.11 (colored)

update from trunk (to remove ancient vax stuff)

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jul 26 18:57:00 1994 UTC (29 years, 7 months ago) by cgd
Branch: MAIN
Changes since 1.10: +1 -4 lines
Diff to previous 1.10 (colored)

kill vax code, at ragge's requeust.

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

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

Revision 1.9 / (download) - annotate - [select for diffs], Fri May 13 06:02:29 1994 UTC (29 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.8: +152 -60 lines
Diff to previous 1.8 (colored)

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

Revision 1.8 / (download) - annotate - [select for diffs], Wed Feb 16 20:12:50 1994 UTC (30 years ago) by mycroft
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

IFF_ALLMULTI is not externally settable.

Revision 1.7 / (download) - annotate - [select for diffs], Thu Feb 10 17:16:33 1994 UTC (30 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.6: +2 -9 lines
Diff to previous 1.6 (colored)

if_init and if_done are not actually used; no point in having them at all.

Revision 1.3.4.4 / (download) - annotate - [select for diffs], Fri Dec 10 11:47:37 1993 UTC (30 years, 3 months ago) by cgd
Branch: magnum
Changes since 1.3.4.3: +4 -4 lines
Diff to previous 1.3.4.3 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

LLC -> LINK

Revision 1.6 / (download) - annotate - [select for diffs], Fri Dec 10 11:45:25 1993 UTC (30 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

slight fix to last

Revision 1.5 / (download) - annotate - [select for diffs], Fri Dec 10 10:57:05 1993 UTC (30 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.4: +4 -12 lines
Diff to previous 1.4 (colored)

the IFF_MULTICAST constant should always be defined.  also,
move IFF_LLC* -> IFF_LINK*; they were misnamed.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Dec 6 04:17:41 1993 UTC (30 years, 3 months ago) by hpeyerl
Branch: MAIN
Changes since 1.3: +11 -1 lines
Diff to previous 1.3 (colored)

multicast support.
From Chris Maeda, cmaeda@cs.washington.edu
These patches are derived from the IP Multicast patches for BSDI.

Revision 1.3.4.3 / (download) - annotate - [select for diffs], Sun Nov 14 20:19:49 1993 UTC (30 years, 3 months ago) by mycroft
Branch: magnum
Changes since 1.3.4.2: +4 -4 lines
Diff to previous 1.3.4.2 (colored) to branchpoint 1.3 (colored)

Canonicalize all #includes.

Revision 1.3.4.2 / (download) - annotate - [select for diffs], Wed Nov 3 21:17:44 1993 UTC (30 years, 4 months ago) by mycroft
Branch: magnum
Changes since 1.3.4.1: +3 -5 lines
Diff to previous 1.3.4.1 (colored) to branchpoint 1.3 (colored)

if_init and if_done aren't actually used anywhere; nuke them.  if_start and
if_watchdog return void.

Revision 1.3.4.1 / (download) - annotate - [select for diffs], Fri Oct 29 04:31:38 1993 UTC (30 years, 4 months ago) by mycroft
Branch: magnum
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored)

Make if_reset #ifdef vax.  (Note: this shifts struct ifnet; rebuild your
kernels from scratch.)

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

add rcs ids to everything, and clean up headers

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

Add consistent multiple-inclusion protection.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 21 09:45:37 1993 UTC (30 years, 11 months ago) by cgd
Branch: WFJ-920714, CSRG
CVS Tags: patchkit-0-2-2, netbsd-alpha-1, netbsd-0-8, WFJ-386bsd-01
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of 386bsd-0.1 sources

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

Initial revision

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




CVSweb <webmaster@jp.NetBSD.org>