Commit Graph

2366 Commits

Author SHA1 Message Date
cherry
e08917ef90 switch all ports to use uvm_init.c:uvm_md_init()
uvm_setpagesize() is now subsumed within this funciton.
2016-12-22 14:47:53 +00:00
ozaki-r
dd8638eea5 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
2016-12-15 09:28:02 +00:00
ozaki-r
74d1e7740b Remove obsolete ancient optimization for bpf
The optimization code was obsoleted over 15 years ago.
We can remove it safely.
2016-12-06 07:49:25 +00:00
msaitoh
8bc54e5be6 KNF. Remove extra spaces. No functional change. 2016-07-07 06:55:38 +00:00
ozaki-r
d938d837b3 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.
2016-06-10 13:27:10 +00:00
ozaki-r
9c4cd06355 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!
2016-02-09 08:32:07 +00:00
christos
d5137ecf34 fenv for m68k 2015-12-24 14:12:39 +00:00
dholland
25d3b9e7cb Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
2015-09-07 03:49:44 +00:00
maxv
e99716e305 Remove KMEMSTATS. 2015-08-12 07:53:56 +00:00
maxv
d22da207ed Remove the KMEMSTATS option. It no longer exists. 2015-08-07 07:29:33 +00:00
ozaki-r
b8199900dc Remove leftover use of AF_NS and NS option
Unnecessary NETISR_NS is also removed.
2015-05-20 09:17:17 +00:00
mlelstv
6f00c789e1 Use C99-style initializers for struct dkdriver. 2015-04-26 15:15:19 +00:00
mrg
2603e0673f remove various HAVE_GCC=45 fragments. 2015-04-15 19:13:46 +00:00
martin
79db564711 Handle EINVAL in the fault path and send SIGBUS on mmap'd access past EOF 2015-03-04 20:29:59 +00:00
christos
c182898b0d We have three sets of DTYPE_ constants in the kernel:
altq		Drop 		Type
	disklabel	Disk 		Type
	file		Descriptor	Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
2015-01-02 19:42:05 +00:00
christos
c60db2e923 make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
2014-12-31 19:52:04 +00:00
manu
239cf5506d Remove unused extended attributes kernel options
As Masao Uebayashi pointed to me, UFS_EXTATTR_AUTOSTART, LFS_EXTATTR_AUTOSTART
and UFS_EXTATTR_AUTOCREATE are not used anywhere in the code. Remove them
as they have been obsolete for a long time:
UFS_EXTATTR_AUTOSTART was replaced by mount -o extattr
LFS_EXTATTR_AUTOSTART was created to match obsolete UFS_EXTATTR_AUTOSTART
UFS_EXTATTR_AUTOCREATE was replaced by sysctl vfs.ffs.extattr_autocreate
2014-11-16 16:01:39 +00:00
manu
2cab231d44 Support for UFS1 extended attributes in GENERIC and GENERIC-like kernels
This change just brings UFS1 extended attribute *support* in the kernel,
extended attributes are not enabled unless three conditions are met:
1) filesystem is UFS1 (newfs -O1)
2) .attribute/system and .attribute/user directories are created at fs root
3) filesystem is mounted with -o extattr

Some GENERIC kernels are obviously memory constrained, the extended
attributes options were not enabled for them, but just added commented out.
(kernel were considered memory constrained if QUOTA option was disabled)
2014-11-12 10:47:20 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
jnemeth
ee79d5b0e4 Create an "options MODULAR_DEFAULT_AUTOLOAD" config option and add
it to all kernel configs that contain "options MODULAR".  This
option turns on module autoloading by default (which is the current
default).  This allows people who don't want module autoloading on
by default to disable it by simply removing/commentting this line.
2014-08-24 07:59:22 +00:00
dholland
4acb6306f5 Systematize (and in many cases, fix) the comments on options COMPAT_NN.
There are quite a few configs that are missing some COMPAT_NN options
in ways that don't make sense; this should probably get cleaned up
too, but for the time being I've not added or removed anything.
2014-08-23 20:26:56 +00:00
tsutsui
c07d3ea4e7 Sync with sparc/dev/fd.c rev 1.155.
> Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().

Note sun3 still uses gcc 4.5.4 but also panicked by this old bug,
so probably this problem was triggered by not gcc 4.8 but struct disk
changes (struct disk_geom was added in <sys/disk.h> rev 1.58),
which increased sizeof(struct fd_softc) from 248 bytes to 296 bytes.
(i.e. now struct fd_softc could be allocated in a different pool block,
 probably near the wrong pointer of the struct disklabel)

Anyway, this fix should be pullued up to netbsd-7.
(probably I'm the only user of floppy on sun3 though)
2014-08-20 17:48:57 +00:00
apb
30a0368950 Add "options COMPAT_70" to all kernel configuration files that
already had "options COMPAT_60".
2014-08-16 17:56:30 +00:00
dholland
f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
dholland
8c70ef39af Add d_discard to all struct bdevsw instances I could find.
I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
2014-07-25 08:02:18 +00:00
abs
1dd8a23cb1 Enable ie0 in DISKLESS for sun3/110 2014-06-25 16:14:43 +00:00
abs
c3de74ff4e Sync (commented out) some of the network and filesystem related
blocks from GENERIC. Only functional change is to comment out tun
in DISKLESS to match GENERIC.
2014-06-04 20:21:24 +00:00
christos
b2543b9136 use cpu_{g,s}etmodel 2014-03-24 20:06:31 +00:00
christos
a87e1c010b avoid dup defs, use global macros 2014-03-24 18:42:56 +00:00
dholland
a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
christos
b1f1b4f3f7 fix unused warnings 2013-11-07 17:50:18 +00:00
christos
e9af1dcdbe don't duplicate definitions 2013-11-07 17:50:02 +00:00
christos
86a5a46882 fix variable usage 2013-11-07 02:37:56 +00:00
tsutsui
8f3d6d39ad Whitespace cleanup. 2013-09-07 15:56:11 +00:00
tsutsui
3e6e9bd41e Tab/whitespace cleanup. 2013-09-06 17:43:19 +00:00
rmind
666e919182 G/C PFIL_HOOKS from the kernel configs. 2013-06-30 21:38:55 +00:00
christos
e46f5f0078 remove obsolete networking options 2013-06-05 23:07:59 +00:00
christos
1cc8b68d4b the bogus number police 2013-04-27 21:43:10 +00:00
christos
dc14ae835f remove confusing numeric locators where they are unused. 2013-04-27 18:19:19 +00:00
christos
2c1aa36c3d Under FAST_IPSEC, IPSEC_ESP is mandatory; GC it. 2013-03-02 02:42:07 +00:00
joerg
e240adbd0b Retire OSI network stack. OK core@ 2013-03-01 18:25:13 +00:00
chs
d4d0b05e7a switch to __USE_TOPDOWN_VM. 2013-01-07 16:58:08 +00:00
chs
0e005595b8 fix compile problems. 2012-10-29 12:55:41 +00:00
chs
4d36a0ad35 no need to define __BROKEN_CONFIG_UNIT_USAGE, the code that this enabled
has been gone for years.
2012-10-28 00:25:59 +00:00
chs
cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
apb
f3929b106b Add "options COMPAT_60" to all kernel configuration files
that already had "options COMPAT_50".
2012-10-17 14:48:07 +00:00
tsutsui
b5d71af96b struct device * -> device_t, struct cfdata * -> cfdata_t
use device_xname()  (from chs@)
2012-10-13 06:37:16 +00:00
tsutsui
542df6ece6 Add a cast to print dev_t. (broken since 64bit dev_t change?) from chs@
XXX: probably no one will use this...
2012-10-13 06:35:54 +00:00
tsutsui
74d1c7d9ea Fix botch on device_t/softc split in #if 0'ed debug printf. from chs@ 2012-10-13 06:32:11 +00:00
tsutsui
fc789a3717 Also reduce UBC_NWINS from default 1024 to 512
to avoid possible KVA shortage, otherwise
"panic: ubc_init: failed to map ubc_object"
could still happen on netbsd-6 branch.

Should be pulled up to netbsd-6.
2012-08-12 20:00:06 +00:00