The NetBSD Project

CVS log for src/sys/rump/net/lib/libshmif/if_shmem.c

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.84 / (download) - annotate - [select for diffs], Sat Apr 9 23:45:02 2022 UTC (2 years ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.83: +4 -4 lines
Diff to previous 1.83 (colored) to selected 1.3 (colored)

if_shmem(4): Use membar_acquire/release for lock acquire/release.

Revision 1.81.10.2 / (download) - annotate - [select for diffs], Sun Aug 1 22:42:44 2021 UTC (2 years, 8 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.81.10.1: +5 -3 lines
Diff to previous 1.81.10.1 (colored) to branchpoint 1.81 (colored) next main 1.82 (colored) to selected 1.3 (colored)

Sync with HEAD.

Revision 1.83 / (download) - annotate - [select for diffs], Wed Jul 14 03:16:06 2021 UTC (2 years, 9 months ago) by ozaki-r
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.82: +5 -3 lines
Diff to previous 1.82 (colored) to selected 1.3 (colored)

shmif: support ALTQ

Revision 1.81.10.1 / (download) - annotate - [select for diffs], Thu Jun 17 04:46:36 2021 UTC (2 years, 10 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.81: +5 -15 lines
Diff to previous 1.81 (colored) to selected 1.3 (colored)

Sync w/ HEAD.

Revision 1.82 / (download) - annotate - [select for diffs], Wed Jun 16 00:21:19 2021 UTC (2 years, 10 months ago) by riastradh
Branch: MAIN
Changes since 1.81: +5 -15 lines
Diff to previous 1.81 (colored) to selected 1.3 (colored)

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around.  And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail.  (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint.  This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken.  However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.

Revision 1.75.2.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:09:01 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.75.2.1: +11 -11 lines
Diff to previous 1.75.2.1 (colored) to branchpoint 1.75 (colored) next main 1.76 (colored) to selected 1.3 (colored)

Merge changes from current as of 20200406

Revision 1.76.6.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:09 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.76: +11 -11 lines
Diff to previous 1.76 (colored) next main 1.77 (colored) to selected 1.3 (colored)

Sync with head.

Revision 1.81 / (download) - annotate - [select for diffs], Tue Feb 25 03:26:18 2020 UTC (4 years, 1 month ago) by ozaki-r
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3
Branch point for: thorpej-i2c-spi-conf
Changes since 1.80: +6 -6 lines
Diff to previous 1.80 (colored) to selected 1.3 (colored)

shmif: reduce the number of calls of cprng(9)

Revision 1.80 / (download) - annotate - [select for diffs], Tue Feb 25 03:25:36 2020 UTC (4 years, 1 month ago) by ozaki-r
Branch: MAIN
Changes since 1.79: +6 -6 lines
Diff to previous 1.79 (colored) to selected 1.3 (colored)

shmif: s/sc_uuid/sc_uid/

It's not UUID :-/

Revision 1.79 / (download) - annotate - [select for diffs], Tue Feb 25 03:24:48 2020 UTC (4 years, 1 month ago) by ozaki-r
Branch: MAIN
Changes since 1.78: +3 -3 lines
Diff to previous 1.78 (colored) to selected 1.3 (colored)

shmif: use cprng_strong64 instead of cprng_fast64 to generate a unique ID

shmif uses random bytes generated by cprng(9) as a unique device ID
between rump kernels to identify packets fed by itself and not receive
them.  So if generated bytes are identical between shmif interfaces on
different rump kernels, shmif may drop incoming packets unintentionally.
This is one cause of recent ATF test failures of IPsec.

Fix it by using cprng_strong64 instead of cprng_fast64.  This is a
workaround and we should also investigate why cprng_fast64 starts
failing on rump kernels, although using cprng_strong64 in initialization
itself is feasible.

Fix PR kern/54897

Revision 1.78 / (download) - annotate - [select for diffs], Thu Feb 20 08:06:15 2020 UTC (4 years, 1 month ago) by ozaki-r
Branch: MAIN
Changes since 1.77: +3 -3 lines
Diff to previous 1.77 (colored) to selected 1.3 (colored)

shmif: use cprng_strong32 to generate random bytes for a MAC address

cprng_fast32 sometimes returns indentical bytes, which look
"20:0e:11:33" in a MAC address, on different rump_server instances.
That leads MAC address duplications resulting in a test failure.

Fix it by using cprng_strong32 instead of cprng_fast32.  However
we should rather fix cprng_fast32 (or rump itself) somehow.

The fix mitigates PR kern/54897 but test failures due to other
causes still remain.

Revision 1.77 / (download) - annotate - [select for diffs], Sat Feb 1 22:38:31 2020 UTC (4 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.76: +4 -4 lines
Diff to previous 1.76 (colored) to selected 1.3 (colored)

Adopt <net/if_stats.h>.

Revision 1.75.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:55 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.75: +90 -51 lines
Diff to previous 1.75 (colored) to selected 1.3 (colored)

Sync with HEAD

Revision 1.74.2.2 / (download) - annotate - [select for diffs], Wed Dec 26 14:02:07 2018 UTC (5 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.74.2.1: +90 -51 lines
Diff to previous 1.74.2.1 (colored) to branchpoint 1.74 (colored) next main 1.75 (colored) to selected 1.3 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.76 / (download) - annotate - [select for diffs], Wed Dec 12 01:51:32 2018 UTC (5 years, 4 months ago) by rin
Branch: MAIN
CVS Tags: phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.75: +90 -51 lines
Diff to previous 1.75 (colored) to selected 1.3 (colored)

Add TX/RX offload capabilities to shmif(4). They are emulated in
software by ether_sw_offload_[tr]x().

For rump kernels, if_capabilities for shmemif(4) can be specified
by environmental variable RUMP_SHMIF_CAPENABLE:

 setenv RUMP_SHMIF_CAPENABLE 0x7ff80 (all offload)
 setenv RUMP_SHMIF_CAPENABLE 0x6aa80 (all TX)
 setenv RUMP_SHMIF_CAPENABLE 0x15500 (all RX)

part of PR kern/53562
OK msaitoh

Revision 1.74.2.1 / (download) - annotate - [select for diffs], Sat Jul 28 04:38:11 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.74: +3 -3 lines
Diff to previous 1.74 (colored) to selected 1.3 (colored)

Sync with HEAD

Revision 1.75 / (download) - annotate - [select for diffs], Tue Jun 26 06:48:03 2018 UTC (5 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728
Branch point for: phil-wifi
Changes since 1.74: +3 -3 lines
Diff to previous 1.74 (colored) to selected 1.3 (colored)

 Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

 This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.

Revision 1.72.8.1 / (download) - annotate - [select for diffs], Sun Dec 10 10:10:25 2017 UTC (6 years, 4 months ago) by snj
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.72: +12 -3 lines
Diff to previous 1.72 (colored) next main 1.73 (colored) to selected 1.3 (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.44.8.5 / (download) - annotate - [select for diffs], Sun Dec 3 11:39:19 2017 UTC (6 years, 4 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.44.8.4: +37 -13 lines
Diff to previous 1.44.8.4 (colored) to branchpoint 1.44 (colored) next main 1.45 (colored) to selected 1.3 (colored)

update from HEAD

Revision 1.74 / (download) - annotate - [select for diffs], Mon Oct 23 12:55:26 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, pgoyette-compat-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.73: +4 -3 lines
Diff to previous 1.73 (colored) to selected 1.3 (colored)

 Fix compile error.

Revision 1.73 / (download) - annotate - [select for diffs], Mon Oct 23 09:31:18 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.72: +11 -3 lines
Diff to previous 1.72 (colored) to selected 1.3 (colored)

 If if_initialize() failed in the attach function, free resources and return.

Revision 1.63.2.4 / (download) - annotate - [select for diffs], Sun Feb 5 13:41:01 2017 UTC (7 years, 2 months ago) by skrll
Branch: nick-nhusb
Changes since 1.63.2.3: +11 -8 lines
Diff to previous 1.63.2.3 (colored) to branchpoint 1.63 (colored) next main 1.64 (colored) to selected 1.3 (colored)

Sync with HEAD

Revision 1.69.2.1 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:52 2017 UTC (7 years, 3 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.69: +10 -7 lines
Diff to previous 1.69 (colored) next main 1.70 (colored) to selected 1.3 (colored)

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

Revision 1.72 / (download) - annotate - [select for diffs], Thu Dec 22 12:55:28 2016 UTC (7 years, 3 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, pgoyette-localcount-20170320, pgoyette-localcount-20170107, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: netbsd-8
Changes since 1.71: +9 -3 lines
Diff to previous 1.71 (colored) to selected 1.3 (colored)

Fix that rump.ifconfig shmifN destroy hangs up

rump.ifconfig shmifN destroy sometimes hangs up on closing a file
descriptor of kqueue under heavy load. It seems it happens because of
a race condition between closing a fd and kevent to the same fd on
another kthread for packet Rx. Fix it by executing the close operation
after the kthread left.

Revision 1.71 / (download) - annotate - [select for diffs], Thu Dec 22 10:13:09 2016 UTC (7 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.70: +3 -4 lines
Diff to previous 1.70 (colored) to selected 1.3 (colored)

Fix handling return value of rumpcomp_shmif_watchwait

Revision 1.70 / (download) - annotate - [select for diffs], Thu Dec 15 09:28:07 2016 UTC (7 years, 4 months ago) by ozaki-r
Branch: MAIN
Changes since 1.69: +2 -4 lines
Diff to previous 1.69 (colored) to selected 1.3 (colored)

Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
  - Where/When if_ipackets is counted up
  - Note that some drivers still update packet statistics in their own
    way (periodical update)
- Moved bpf_mtap run in softint
  - This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net

Revision 1.63.2.3 / (download) - annotate - [select for diffs], Sat Jul 9 20:25:24 2016 UTC (7 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.63.2.2: +7 -7 lines
Diff to previous 1.63.2.2 (colored) to branchpoint 1.63 (colored) to selected 1.3 (colored)

Sync with HEAD

Revision 1.69 / (download) - annotate - [select for diffs], Thu Jul 7 06:55:44 2016 UTC (7 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.68: +3 -3 lines
Diff to previous 1.68 (colored) to selected 1.3 (colored)

KNF. Remove extra spaces. No functional change.

Revision 1.68 / (download) - annotate - [select for diffs], Thu Jun 16 02:38:40 2016 UTC (7 years, 10 months ago) by ozaki-r
Branch: MAIN
Changes since 1.67: +5 -5 lines
Diff to previous 1.67 (colored) to selected 1.3 (colored)

Use curlwp_bind and curlwp_bindx instead of open-coding LP_BOUND

Revision 1.67 / (download) - annotate - [select for diffs], Fri Jun 10 13:27:16 2016 UTC (7 years, 10 months ago) by ozaki-r
Branch: MAIN
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored) to selected 1.3 (colored)

Introduce m_set_rcvif and m_reset_rcvif

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

No functional change.

Revision 1.63.2.2 / (download) - annotate - [select for diffs], Fri Apr 22 15:44:19 2016 UTC (7 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.63.2.1: +6 -2 lines
Diff to previous 1.63.2.1 (colored) to branchpoint 1.63 (colored) to selected 1.3 (colored)

Sync with HEAD

Revision 1.66 / (download) - annotate - [select for diffs], Tue Apr 19 05:48:10 2016 UTC (8 years ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422
Changes since 1.65: +6 -2 lines
Diff to previous 1.65 (colored) to selected 1.3 (colored)

Prevent LWP migrations between CPUs during upper layer processing

This is a contract of psref(9) that is used by upper layer componenets,
e.g., bridge(4).

Revision 1.63.2.1 / (download) - annotate - [select for diffs], Sat Mar 19 11:30:38 2016 UTC (8 years, 1 month ago) by skrll
Branch: nick-nhusb
Changes since 1.63: +8 -6 lines
Diff to previous 1.63 (colored) to selected 1.3 (colored)

Sync with HEAD

Revision 1.65 / (download) - annotate - [select for diffs], Tue Feb 9 08:32:12 2016 UTC (8 years, 2 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319
Changes since 1.64: +5 -4 lines
Diff to previous 1.64 (colored) to selected 1.3 (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.64 / (download) - annotate - [select for diffs], Tue Jan 26 23:12:19 2016 UTC (8 years, 2 months ago) by pooka
Branch: MAIN
Changes since 1.63: +5 -4 lines
Diff to previous 1.63 (colored) to selected 1.3 (colored)

Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories.  Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.

Revision 1.44.8.4 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:43 2014 UTC (9 years, 8 months ago) by tls
Branch: tls-maxphys
Changes since 1.44.8.3: +9 -6 lines
Diff to previous 1.44.8.3 (colored) to branchpoint 1.44 (colored) to selected 1.3 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.62.2.1 / (download) - annotate - [select for diffs], Sun Aug 17 03:26:51 2014 UTC (9 years, 8 months ago) by riz
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.62: +10 -4 lines
Diff to previous 1.62 (colored) next main 1.63 (colored) to selected 1.3 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #28):
	sys/rump/net/lib/libshmif/shmifvar.h: revision 1.8
	sys/rump/net/lib/libshmif/if_shmem.c: revision 1.63
	sys/rump/net/lib/libshmif/shmifvar.h: revision 1.9
Make shmif SIMPLEX
Add a sender field to a packet header on a shmif bus to identify
and ignore packets sent by itself.
This makes shmif work with bridges.
ok pooka@
Bump SHMIF_VERSION

Revision 1.63 / (download) - annotate - [select for diffs], Fri Aug 15 15:03:03 2014 UTC (9 years, 8 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.62: +10 -4 lines
Diff to previous 1.62 (colored) to selected 1.3 (colored)

Make shmif SIMPLEX

Add a sender field to a packet header on a shmif bus to identify
and ignore packets sent by itself.

This makes shmif work with bridges.

ok pooka@

Revision 1.60.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:56:52 2014 UTC (9 years, 8 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.60: +4 -4 lines
Diff to previous 1.60 (colored) next main 1.61 (colored) to selected 1.3 (colored)

Rebase.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Aug 9 09:43:49 2014 UTC (9 years, 8 months ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-maxphys-base, netbsd-7-base
Branch point for: netbsd-7
Changes since 1.61: +4 -2 lines
Diff to previous 1.61 (colored) to selected 1.3 (colored)

Count packets in if_shmem

ok @pooka

Revision 1.61 / (download) - annotate - [select for diffs], Wed May 28 20:57:22 2014 UTC (9 years, 10 months ago) by justin
Branch: MAIN
CVS Tags: tls-earlyentropy-base
Changes since 1.60: +4 -4 lines
Diff to previous 1.60 (colored) to selected 1.3 (colored)

Add missing __diagused in rump code

Revision 1.43.2.4 / (download) - annotate - [select for diffs], Thu May 22 11:41:17 2014 UTC (9 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.43.2.3: +56 -35 lines
Diff to previous 1.43.2.3 (colored) to branchpoint 1.43 (colored) next main 1.44 (colored) to selected 1.3 (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.56.2.2 / (download) - annotate - [select for diffs], Sun May 18 17:46:20 2014 UTC (9 years, 11 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.56.2.1: +4 -6 lines
Diff to previous 1.56.2.1 (colored) to branchpoint 1.56 (colored) next main 1.57 (colored) to selected 1.3 (colored)

sync with head

Revision 1.60 / (download) - annotate - [select for diffs], Thu Mar 20 20:42:08 2014 UTC (10 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Branch point for: tls-earlyentropy
Changes since 1.59: +3 -3 lines
Diff to previous 1.59 (colored) to selected 1.3 (colored)

kill sprintf

Revision 1.59 / (download) - annotate - [select for diffs], Thu Mar 13 01:42:59 2014 UTC (10 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: riastradh-drm2-base3
Changes since 1.58: +3 -3 lines
Diff to previous 1.58 (colored) to selected 1.3 (colored)

rename rumpcomp_user.* -> shmif_user.*

Revision 1.58 / (download) - annotate - [select for diffs], Fri Sep 13 20:38:04 2013 UTC (10 years, 7 months ago) by joerg
Branch: MAIN
Changes since 1.57: +2 -4 lines
Diff to previous 1.57 (colored) to selected 1.3 (colored)

Remove busversion.

Revision 1.56.2.1 / (download) - annotate - [select for diffs], Wed Aug 28 23:59:37 2013 UTC (10 years, 7 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.56: +5 -2 lines
Diff to previous 1.56 (colored) to selected 1.3 (colored)

sync with head

Revision 1.56.4.1 / (download) - annotate - [select for diffs], Tue Jul 23 21:07:37 2013 UTC (10 years, 8 months ago) by riastradh
Branch: riastradh-drm2
Changes since 1.56: +5 -2 lines
Diff to previous 1.56 (colored) next main 1.57 (colored) to selected 1.3 (colored)

sync with HEAD

Revision 1.57 / (download) - annotate - [select for diffs], Mon Jul 22 21:12:03 2013 UTC (10 years, 8 months ago) by pooka
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1
Changes since 1.56: +5 -2 lines
Diff to previous 1.56 (colored) to selected 1.3 (colored)

In recv, align data after ether_header at _ALIGN_BYTES.

Revision 1.44.8.3 / (download) - annotate - [select for diffs], Sun Jun 23 06:20:29 2013 UTC (10 years, 9 months ago) by tls
Branch: tls-maxphys
Changes since 1.44.8.2: +52 -32 lines
Diff to previous 1.44.8.2 (colored) to branchpoint 1.44 (colored) to selected 1.3 (colored)

resync from head

Revision 1.56 / (download) - annotate - [select for diffs], Fri Jun 14 05:59:50 2013 UTC (10 years, 10 months ago) by pooka
Branch: MAIN
CVS Tags: riastradh-drm2-base
Branch point for: rmind-smpnet, riastradh-drm2
Changes since 1.55: +6 -2 lines
Diff to previous 1.55 (colored) to selected 1.3 (colored)

sauce previous with a comment

Revision 1.55 / (download) - annotate - [select for diffs], Fri Jun 14 05:56:29 2013 UTC (10 years, 10 months ago) by pooka
Branch: MAIN
Changes since 1.54: +8 -2 lines
Diff to previous 1.54 (colored) to selected 1.3 (colored)

Ignore too short packets.  This condition is true especially for the
first packet on a new bus (len == 0).  Everything else in the stack
besides bpf seemed to be able to deal with one, though.

Revision 1.54 / (download) - annotate - [select for diffs], Wed May 1 06:58:36 2013 UTC (10 years, 11 months ago) by pooka
Branch: MAIN
CVS Tags: khorben-n900
Changes since 1.53: +4 -4 lines
Diff to previous 1.53 (colored) to selected 1.3 (colored)

Three cheers for the mighty C type system that doesn't recognize the
difference between an enum and an integer.  Due to wrong parameter order,
the lock backoff routine ended up sleeping 1 million seconds instead
of 1ms.  On the plus side, we got some sort of idea how often the shmif
spinlock backoff routine is hit during a standard test run.

Revision 1.53 / (download) - annotate - [select for diffs], Tue Apr 30 00:03:54 2013 UTC (10 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.52: +22 -19 lines
Diff to previous 1.52 (colored) to selected 1.3 (colored)

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.

Revision 1.52 / (download) - annotate - [select for diffs], Mon Apr 29 20:08:49 2013 UTC (10 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.51: +20 -9 lines
Diff to previous 1.51 (colored) to selected 1.3 (colored)

Reduce hypercalls related to reading to essentially an amalgamation
of readv and preadv.  ditto for writing.  Hypercalls are so seldomly
used that it doesn't justify 3x the calls for syntactic sugar.

Revision 1.51 / (download) - annotate - [select for diffs], Mon Apr 29 13:17:32 2013 UTC (10 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.50: +3 -5 lines
Diff to previous 1.50 (colored) to selected 1.3 (colored)

add a private hypercall to map the bus into memory

Revision 1.50 / (download) - annotate - [select for diffs], Sun Apr 28 13:17:25 2013 UTC (10 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.49: +5 -8 lines
Diff to previous 1.49 (colored) to selected 1.3 (colored)

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).

Revision 1.49 / (download) - annotate - [select for diffs], Sun Apr 28 10:53:21 2013 UTC (10 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.48: +4 -4 lines
Diff to previous 1.48 (colored) to selected 1.3 (colored)

* remove the unused "opaque" parameter
* fix some typos in the previous

Revision 1.48 / (download) - annotate - [select for diffs], Sun Apr 28 10:43:45 2013 UTC (10 years, 11 months ago) by pooka
Branch: MAIN
Changes since 1.47: +5 -4 lines
Diff to previous 1.47 (colored) to selected 1.3 (colored)

make the file monitoring hypercalls private to shmif

Revision 1.44.8.2 / (download) - annotate - [select for diffs], Mon Feb 25 00:30:10 2013 UTC (11 years, 1 month ago) by tls
Branch: tls-maxphys
Changes since 1.44.8.1: +8 -6 lines
Diff to previous 1.44.8.1 (colored) to branchpoint 1.44 (colored) to selected 1.3 (colored)

resync with head

Revision 1.44.4.1 / (download) - annotate - [select for diffs], Fri Feb 8 20:51:12 2013 UTC (11 years, 2 months ago) by riz
Branch: netbsd-6
CVS Tags: 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
Changes since 1.44: +3 -4 lines
Diff to previous 1.44 (colored) next main 1.45 (colored) to selected 1.3 (colored)

Pull up following revision(s) (requested by gdt in ticket #796):
	sys/rump/net/lib/libshmif/if_shmem.c: revision 1.46
Pass up all multicast addresses, not just broadcast.  Among other
things, makes IPv6 work over this interface.

Revision 1.43.2.3 / (download) - annotate - [select for diffs], Wed Jan 23 00:06:29 2013 UTC (11 years, 2 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.43.2.2: +8 -6 lines
Diff to previous 1.43.2.2 (colored) to branchpoint 1.43 (colored) to selected 1.3 (colored)

sync with head

Revision 1.47 / (download) - annotate - [select for diffs], Mon Jan 14 20:21:32 2013 UTC (11 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base8, agc-symver-base, agc-symver
Changes since 1.46: +8 -6 lines
Diff to previous 1.46 (colored) to selected 1.3 (colored)

fix debug printf formats

Revision 1.44.8.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:02:51 2012 UTC (11 years, 4 months ago) by tls
Branch: tls-maxphys
Changes since 1.44: +7 -6 lines
Diff to previous 1.44 (colored) to selected 1.3 (colored)

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

Revision 1.43.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:55 2012 UTC (11 years, 5 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.43.2.1: +7 -6 lines
Diff to previous 1.43.2.1 (colored) to branchpoint 1.43 (colored) to selected 1.3 (colored)

sync with head

Revision 1.46 / (download) - annotate - [select for diffs], Thu Oct 11 10:50:45 2012 UTC (11 years, 6 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6
Changes since 1.45: +3 -4 lines
Diff to previous 1.45 (colored) to selected 1.3 (colored)

Pass up all multicast addresses, not just broadcast.  Among other
things, makes IPv6 work over this interface.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Sep 14 16:29:22 2012 UTC (11 years, 7 months ago) by pooka
Branch: MAIN
Changes since 1.44: +6 -4 lines
Diff to previous 1.44 (colored) to selected 1.3 (colored)

Do not assume that O_FOO flags have matching values in the rump kernel
and hypervisor.

Revision 1.43.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:08:50 2012 UTC (12 years ago) by yamt
Branch: yamt-pagecache
Changes since 1.43: +4 -3 lines
Diff to previous 1.43 (colored) to selected 1.3 (colored)

sync with head

Revision 1.44 / (download) - annotate - [select for diffs], Sat Nov 19 22:51:31 2011 UTC (12 years, 5 months ago) by tls
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-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
Branch point for: tls-maxphys, netbsd-6
Changes since 1.43: +4 -3 lines
Diff to previous 1.43 (colored) to selected 1.3 (colored)

First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Sep 2 22:25:08 2011 UTC (12 years, 7 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache
Changes since 1.42: +18 -8 lines
Diff to previous 1.42 (colored) to selected 1.3 (colored)

Report vmem(9) errors out-of-band so that we can use vmem(9) to manage
ranges that include the least and the greatest vmem_addr_t.  Update
vmem(9) uses throughout the kernel.  Slightly expand on the tests in
subr_vmem.c, which still pass.  I've been running a kernel with this
patch without any trouble.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Aug 25 15:14:19 2011 UTC (12 years, 7 months ago) by dyoung
Branch: MAIN
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored) to selected 1.3 (colored)

Use VMEM_ADDR_MIN and VMEM_ADDR_MAX.

Revision 1.41 / (download) - annotate - [select for diffs], Tue Aug 23 22:00:57 2011 UTC (12 years, 7 months ago) by dyoung
Branch: MAIN
Changes since 1.40: +5 -7 lines
Diff to previous 1.40 (colored) to selected 1.3 (colored)

Introduce a couple of new constants, VMEM_ADDR_MIN (the least possible
address in a vmem(9) arena, 0) and VMEM_ADDR_MAX (the maximum possible
address, currently 0xFFFFFFFF).  Modify several boundary conditions so
that a vmem(9) arena can allocate ranges including VMEM_ADDR_MAX.
Update documentation and tests.

These changes pass the tests in sys/kern/subr_vmem.c.  To compile the
and run the test program, run "cd sys/kern/ && gcc -DVMEM_SANITY -o
subr_vmem ./subr_vmem.c && ./subr_vmem".

Revision 1.40 / (download) - annotate - [select for diffs], Sun Aug 7 14:03:16 2011 UTC (12 years, 8 months ago) by rmind
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored) to selected 1.3 (colored)

Rename slightly misleading KTHREAD_JOINABLE to KTHREAD_MUSTJOIN.

Revision 1.33.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:10:09 2011 UTC (12 years, 10 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.33: +34 -10 lines
Diff to previous 1.33 (colored) next main 1.34 (colored) to selected 1.3 (colored)

Sync with HEAD.

Revision 1.10.4.2 / (download) - annotate - [select for diffs], Thu Apr 21 01:42:18 2011 UTC (13 years ago) by rmind
Branch: rmind-uvmplock
Changes since 1.10.4.1: +32 -8 lines
Diff to previous 1.10.4.1 (colored) to branchpoint 1.10 (colored) next main 1.11 (colored) to selected 1.3 (colored)

sync with head

Revision 1.39 / (download) - annotate - [select for diffs], Mon Mar 21 16:41:09 2011 UTC (13 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored) to selected 1.3 (colored)

Update copyright statements.

no functional change.

Revision 1.38 / (download) - annotate - [select for diffs], Fri Mar 11 12:11:00 2011 UTC (13 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.37: +4 -3 lines
Diff to previous 1.37 (colored) to selected 1.3 (colored)

make the if-else logic more obvious

Revision 1.37 / (download) - annotate - [select for diffs], Fri Mar 11 12:10:15 2011 UTC (13 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.36: +22 -8 lines
Diff to previous 1.36 (colored) to selected 1.3 (colored)

After my change to the "interface accepts this packet" logic
yesterday the CARP test stopped working, since CARP depends on
IFF_PROMISC (which was previously always accidentally enabled).
While making the interface honor IFF_PROMISC, also make it compare
the received frame's address against ifp->if_sadl instead of a
local enaddr value we cached when the interface was created.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Mar 11 09:25:59 2011 UTC (13 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.35: +8 -4 lines
Diff to previous 1.35 (colored) to selected 1.3 (colored)

Don't assume rump kernel PAGE_SIZE and host page size are the same.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Mar 10 13:27:03 2011 UTC (13 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.34: +6 -2 lines
Diff to previous 1.34 (colored) to selected 1.3 (colored)

Support bpf.  shmif_dumpbus(1) can be used for much the same effect,
but sometimes it's just more convenient to run tcpdump live.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Mar 10 13:20:54 2011 UTC (13 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.33: +5 -4 lines
Diff to previous 1.33 (colored) to selected 1.3 (colored)

Pass packet up if it's *for* us, not if it's from someone else.
This fixes a rather curious forwarding/redirect/etc. storm which
happened when there were >2 shmif kernels on the same shmbus with
ip forwarding set on. (at least it stress-tested other code ;)

Revision 1.10.4.1 / (download) - annotate - [select for diffs], Sat Mar 5 20:56:21 2011 UTC (13 years, 1 month ago) by rmind
Branch: rmind-uvmplock
Changes since 1.10: +498 -167 lines
Diff to previous 1.10 (colored) to selected 1.3 (colored)

sync with head

Revision 1.33 / (download) - annotate - [select for diffs], Mon Dec 6 10:48:18 2010 UTC (13 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, jruoho-x86intr-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: jruoho-x86intr
Changes since 1.32: +16 -7 lines
Diff to previous 1.32 (colored) to selected 1.3 (colored)

Allow creation with NULL busname (to be later set with SIOCSLINKSTR).

Revision 1.32 / (download) - annotate - [select for diffs], Wed Nov 17 17:51:22 2010 UTC (13 years, 5 months ago) by pooka
Branch: MAIN
Changes since 1.31: +118 -36 lines
Diff to previous 1.31 (colored) to selected 1.3 (colored)

Support destroy in shmif.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Nov 16 20:08:24 2010 UTC (13 years, 5 months ago) by pooka
Branch: MAIN
Changes since 1.30: +22 -10 lines
Diff to previous 1.30 (colored) to selected 1.3 (colored)

Use vmem for keeping track of unit numbers so that wildcard allocation
works correctly.

Revision 1.30 / (download) - annotate - [select for diffs], Mon Nov 15 23:59:06 2010 UTC (13 years, 5 months ago) by pooka
Branch: MAIN
Changes since 1.29: +4 -5 lines
Diff to previous 1.29 (colored) to selected 1.3 (colored)

"fix" completely crackheaded code w/ uninitialized use,
missed as usual by the wonderful -g -O0

Revision 1.29 / (download) - annotate - [select for diffs], Mon Nov 15 22:48:06 2010 UTC (13 years, 5 months ago) by pooka
Branch: MAIN
Changes since 1.28: +202 -44 lines
Diff to previous 1.28 (colored) to selected 1.3 (colored)

* make interface a cloner
* use SIOCSLINKSTR for supplying bus filename in case of cloned if

TODO: downing interface, unclone, and some tweaks for robustness

Revision 1.10.2.2 / (download) - annotate - [select for diffs], Fri Oct 22 07:22:53 2010 UTC (13 years, 5 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.10.2.1: +136 -45 lines
Diff to previous 1.10.2.1 (colored) to branchpoint 1.10 (colored) next main 1.11 (colored) to selected 1.3 (colored)

Sync with HEAD (-D20101022).

Revision 1.6.2.6 / (download) - annotate - [select for diffs], Sat Oct 9 03:32:45 2010 UTC (13 years, 6 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.6.2.5: +198 -143 lines
Diff to previous 1.6.2.5 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored) to selected 1.3 (colored)

sync with head

Revision 1.28 / (download) - annotate - [select for diffs], Tue Aug 17 20:42:47 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, uebayasi-xip-base4, uebayasi-xip-base3
Changes since 1.27: +30 -2 lines
Diff to previous 1.27 (colored) to selected 1.3 (colored)

Prefault bus pages in driver attachment.  This seems to work around
weird corruption I've been seeing (most likely a host kernel bug).

For more details, see thread at:
http://mail-index.netbsd.org/tech-kern/2010/08/17/msg008749.html

Revision 1.27 / (download) - annotate - [select for diffs], Tue Aug 17 11:35:23 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.26: +60 -25 lines
Diff to previous 1.26 (colored) to selected 1.3 (colored)

* fix off-by-wrap case where current datagram aligns exactly with
  the end of the bus
* clarify the "can we still use the device's next pointer" calculation
  and move it to its own routine
* sprinkle dprintf

Revision 1.10.2.1 / (download) - annotate - [select for diffs], Tue Aug 17 06:48:05 2010 UTC (13 years, 8 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.10: +106 -126 lines
Diff to previous 1.10 (colored) to selected 1.3 (colored)

Sync with HEAD.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Aug 16 17:33:52 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.25: +72 -44 lines
Diff to previous 1.25 (colored) to selected 1.3 (colored)

simplify, improve, etc.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Aug 15 21:57:58 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
CVS Tags: uebayasi-xip-base2
Changes since 1.24: +4 -3 lines
Diff to previous 1.24 (colored) to selected 1.3 (colored)

reset pktsize each loop

Revision 1.24 / (download) - annotate - [select for diffs], Sun Aug 15 21:41:39 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.23: +7 -4 lines
Diff to previous 1.23 (colored) to selected 1.3 (colored)

reset wrap where necessary

Revision 1.23 / (download) - annotate - [select for diffs], Sun Aug 15 18:55:03 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.22: +42 -2 lines
Diff to previous 1.22 (colored) to selected 1.3 (colored)

Move the lockops together with the interface -- they are needed
only at runtime.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Aug 15 18:48:38 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.21: +4 -2 lines
Diff to previous 1.21 (colored) to selected 1.3 (colored)

Take kernel lock before passing data to if_input.  This is in line
with IPL_NET interrupts generally not being MPSAFE.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Aug 15 18:40:41 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.20: +6 -6 lines
Diff to previous 1.20 (colored) to selected 1.3 (colored)

Don't do timestamping with buslock held.  it's the little things ...

Revision 1.20 / (download) - annotate - [select for diffs], Fri Aug 13 10:13:44 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.19: +19 -8 lines
Diff to previous 1.19 (colored) to selected 1.3 (colored)

Include a timestamp in the frame header.  When converting to pcap,
it can give some idea of when packets were sent.

nb. it's the sending host's timestamp, not an observer timestamp
like in the typical pcap case.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Aug 12 21:41:47 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.18: +37 -131 lines
Diff to previous 1.18 (colored) to selected 1.3 (colored)

Include a pointer to the beginning of the buffer and add support
to the packet dumper.  This helps in situations where the juicy
details are in a bus multiple generations old.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Aug 12 18:39:54 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.17: +11 -10 lines
Diff to previous 1.17 (colored) to selected 1.3 (colored)

further simplify & fix calculations

Revision 1.17 / (download) - annotate - [select for diffs], Thu Aug 12 18:17:23 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.16: +16 -16 lines
Diff to previous 1.16 (colored) to selected 1.3 (colored)

* include a magic number in the bus format
* simplify offset calculations by making them start from beginning of data

Revision 1.16 / (download) - annotate - [select for diffs], Thu Aug 12 17:33:55 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.15: +22 -29 lines
Diff to previous 1.15 (colored) to selected 1.3 (colored)

Make shmif memory access slightly more sane.  Create a header which
is shared by the interface and the bus analyzer.

Revision 1.6.2.5 / (download) - annotate - [select for diffs], Wed Aug 11 22:55:09 2010 UTC (13 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.6.2.4: +24 -8 lines
Diff to previous 1.6.2.4 (colored) to branchpoint 1.6 (colored) to selected 1.3 (colored)

sync with head.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Aug 11 12:10:39 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.14: +17 -10 lines
Diff to previous 1.14 (colored) to selected 1.3 (colored)

* remove some magic numbers from the code
* include bus version number in header just in case we want to examine
  bus traffic at some point in the future

Revision 1.14 / (download) - annotate - [select for diffs], Wed Aug 11 10:30:30 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.13: +9 -9 lines
Diff to previous 1.13 (colored) to selected 1.3 (colored)

Change bus header a little: reserve only 32bits for the lock and
use 32bit atomic ops to handle it.  Begin data from 0x10 instead
of 0x14.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Aug 10 18:17:12 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base10
Changes since 1.12: +15 -5 lines
Diff to previous 1.12 (colored) to selected 1.3 (colored)

* use atomic ops instead of __cpu_simple_luck
* this interface is un-IFF_SIMPLEX

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jul 29 22:48:11 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.11: +8 -3 lines
Diff to previous 1.11 (colored) to selected 1.3 (colored)

* print interface number, backend path and ethernet address for dmesg
* make kassert more demanding

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jul 29 18:30:39 2010 UTC (13 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.10: +5 -4 lines
Diff to previous 1.10 (colored) to selected 1.3 (colored)

* increase bus size so that we don't wrap so quickly when NFS
  flushes writes
* verbosize debug print a bit

Revision 1.6.2.4 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:40 2010 UTC (14 years, 1 month ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.6.2.3: +6 -7 lines
Diff to previous 1.6.2.3 (colored) to branchpoint 1.6 (colored) to selected 1.3 (colored)

sync with head

Revision 1.10 / (download) - annotate - [select for diffs], Mon Nov 30 11:14:58 2009 UTC (14 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1, uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored) to selected 1.3 (colored)

fix comment

Revision 1.9 / (download) - annotate - [select for diffs], Tue Oct 20 23:29:57 2009 UTC (14 years, 6 months ago) by pooka
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.8: +3 -4 lines
Diff to previous 1.8 (colored) to selected 1.3 (colored)

use autogenerated prototype

Revision 1.8 / (download) - annotate - [select for diffs], Tue Oct 20 23:21:53 2009 UTC (14 years, 6 months ago) by pooka
Branch: MAIN
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored) to selected 1.3 (colored)

printf -> rumpuser_dprintf
(can't use printf while holding spinlock)

Revision 1.6.4.3 / (download) - annotate - [select for diffs], Thu Jul 23 23:32:56 2009 UTC (14 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.6.4.2: +4 -2 lines
Diff to previous 1.6.4.2 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored) to selected 1.3 (colored)

Sync with HEAD.

Revision 1.6.2.3 / (download) - annotate - [select for diffs], Sat Jun 20 07:20:37 2009 UTC (14 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.6.2.2: +4 -2 lines
Diff to previous 1.6.2.2 (colored) to branchpoint 1.6 (colored) to selected 1.3 (colored)

sync with head

Revision 1.7 / (download) - annotate - [select for diffs], Tue May 26 19:03:05 2009 UTC (14 years, 10 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, jymxensuspend-base
Changes since 1.6: +4 -2 lines
Diff to previous 1.6 (colored) to selected 1.3 (colored)

Filter out ENETRESET from ether_ioctl() since we aren't interested
in multicast hugging.

Revision 1.6.4.2 / (download) - annotate - [select for diffs], Wed May 13 17:23:02 2009 UTC (14 years, 11 months ago) by jym
Branch: jym-xensuspend
Changes since 1.6.4.1: +377 -0 lines
Diff to previous 1.6.4.1 (colored) to branchpoint 1.6 (colored) to selected 1.3 (colored)

Sync with HEAD.

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

Revision 1.6.2.2 / (download) - annotate - [select for diffs], Mon May 4 08:14:33 2009 UTC (14 years, 11 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.6.2.1: +384 -0 lines
Diff to previous 1.6.2.1 (colored) to branchpoint 1.6 (colored) to selected 1.3 (colored)

sync with head.

Revision 1.4.2.3 / (download) - annotate - [select for diffs], Tue Apr 28 07:37:52 2009 UTC (14 years, 11 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.4.2.2: +10 -3 lines
Diff to previous 1.4.2.2 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored) to selected 1.3 (colored)

Sync with HEAD.

Revision 1.6.4.1, Mon Apr 6 20:41:29 2009 UTC (15 years ago) by jym
Branch: jym-xensuspend
Changes since 1.6: +0 -384 lines
FILE REMOVED

file if_shmem.c was added on branch jym-xensuspend on 2009-05-13 17:23:02 +0000

Revision 1.6.2.1, Mon Apr 6 20:41:29 2009 UTC (15 years ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.6: +0 -384 lines
FILE REMOVED

file if_shmem.c was added on branch yamt-nfs-mp on 2009-05-04 08:14:33 +0000

Revision 1.6 / (download) - annotate - [select for diffs], Mon Apr 6 20:41:29 2009 UTC (15 years ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jym-xensuspend-base
Branch point for: yamt-nfs-mp, jym-xensuspend
Changes since 1.5: +8 -2 lines
Diff to previous 1.5 (colored) to selected 1.3 (colored)

let drivers define DPRINTF

Revision 1.5 / (download) - annotate - [select for diffs], Wed Mar 18 15:32:27 2009 UTC (15 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.4: +4 -3 lines
Diff to previous 1.4 (colored) to selected 1.3 (colored)

* allow to specify PROT_READ/PROT_WRITE when mmapping a file
* add msync

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Tue Mar 3 18:34:31 2009 UTC (15 years, 1 month ago) by skrll
Branch: nick-hppapmap
Changes since 1.4.2.1: +377 -0 lines
Diff to previous 1.4.2.1 (colored) to branchpoint 1.4 (colored) to selected 1.3 (colored)

Sync with HEAD.

Revision 1.4.2.1, Sun Mar 1 20:50:04 2009 UTC (15 years, 1 month ago) by skrll
Branch: nick-hppapmap
Changes since 1.4: +0 -377 lines
FILE REMOVED

file if_shmem.c was added on branch nick-hppapmap on 2009-03-03 18:34:31 +0000

Revision 1.4 / (download) - annotate - [select for diffs], Sun Mar 1 20:50:04 2009 UTC (15 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Branch point for: nick-hppapmap
Changes since 1.3: +11 -14 lines
Diff to previous 1.3 (colored)

Create receive thread only in if_start() to make sure it happens
after the we have been attached to the ethernet framework.
XXX: if_stop is still unimplemented

Revision 1.3 / (download) - annotate - [selected], Sun Mar 1 07:10:41 2009 UTC (15 years, 1 month ago) by martin
Branch: MAIN
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 (colored)

add missing atomic.h include

Revision 1.2 / (download) - annotate - [select for diffs], Sat Feb 28 16:15:19 2009 UTC (15 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.1: +9 -3 lines
Diff to previous 1.1 (colored) to selected 1.3 (colored)

don't require the ifnum return pointer.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Feb 28 15:28:46 2009 UTC (15 years, 1 month ago) by pooka
Branch: MAIN
Diff to selected 1.3 (colored)

Add a virtual ethernet interface which uses shared memory as the
bus instead of relying on the host kernel's tap and bridge.  This
is much lighterweight approach which does not consume non-pageable
kernel resources.

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>