DragonFly BSD

CVS log for src/sys/net/bpf.c

[BACK] Up to [DragonFly] / src / sys / net

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.50: download - view: text, markup, annotated - select for diffs
Tue Sep 23 11:28:49 2008 UTC (5 years, 11 months ago) by sephe
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.49: preferred, unified
Changes since revision 1.49: +1 -1 lines
Add following three network protocol threads running mode:
1) BGL (default)
2) Adaptive BGL.  Protocol threads run without BGL by default.  BGL will be
   held if the received msg does not have MSGF_MPSAFE turned on the ms_flags
   field
3) No BGL (experimental)

The code on the main path is done by dillon@

Following three sysctls and tunables are added to adjust the "mode":
net.netisr.mpsafe_thread
net.inet.tcp.mpsafe_thread
net.inet.udp.mpsafe_thread

They have same set of values,
0 (default) -- BGL
1 	    -- Adaptive BGL
2 	    -- No BGL



NETISR_FLAG_MPSAFE is added (netisr.ni_flags), so that:
- netisr_queue() and schednetisr() could set MSGF_MPSAFE during msg
  initialization
- netisr_run() (called by ether_input_oncpu()) could hold BGL based on this flag
  before calling netisr's handler



PR_MPSAFE is added (protosw.pr_flags), so that tranport_processing_oncpu() could
hold BGL before calling protocol's input handler



Kernel API changes:
- The thread parameter to netmsg_service_loop() must be supplied (running mode)
  and it must have the type of "int *"
- netisr_register() takes additional flags parameter to indicate whether its
  handler is MPSAFE (NETISR_FLAG_MPSAFE) or not

Reviewed-by: dillon@

Revision 1.49: download - view: text, markup, annotated - select for diffs
Wed Sep 17 13:38:28 2008 UTC (5 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.48: preferred, unified
Changes since revision 1.48: +30 -7 lines
Call ifnet.if_output() in netisr0, so it executes in a controlled enviroment.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Wed Sep 17 11:46:43 2008 UTC (5 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.47: preferred, unified
Changes since revision 1.47: +1 -1 lines
'dst' does not need to be static

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sun Aug 17 03:44:48 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.46: preferred, unified
Changes since revision 1.46: +23 -1 lines
Various tap functions of bpf(4) are the only non-MPSAFE code on ethernet
input path (in polling or interrupt threads), so push mplock holding down
into bpf(4) tap functions.  Also re-check the bpf_if after holding mplock
to avoid use-after-check race.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Sat Aug 16 13:10:59 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.45: preferred, unified
Changes since revision 1.45: +2 -2 lines
- bpfpoll() is a static function
- minor white space change

Revision 1.45: download - view: text, markup, annotated - select for diffs
Wed May 14 11:59:23 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0, DragonFly_Preview
Diff to: previous 1.44: preferred, unified
Changes since revision 1.44: +1 -3 lines
Reduce ifnet.if_serializer contention on output path:
- Push ifnet.if_serializer holding down into each ifnet.if_output implementation
- Add a serializer into ifaltq, which is used to protect send queue instead of
  its parent's if_serializer.  This change has following implication:
  o  On output path, enqueueing packets and calling ifnet.if_start are decoupled
  o  In device drivers, poll->dev_encap_ok->dequeue operation sequence is no
     longer safe, instead dequeue->dev_encap_fail->prepend should be used
  This serializer will be held by using lwkt_serialize_adaptive_enter()
- Add altq_started field into ifaltq, which is used to interlock the calling
  of its parent's if_start, to reduce ifnet.if_serializer contention.
  if_devstart(), a helper function which utilizes ifaltq.altq_started, is added
  to reduce code duplication in ethernet device drivers.
- Add if_cpuid into ifnet.  This field indicates on which CPU device driver's
  interrupt will happen.
- Add ifq_dispatch().  This function will try to hold ifnet.if_serializer in
  order to call ifnet.if_start.  If this attempt fails, this function will
  schedule ifnet.if_start to be called on CPU located by ifnet.if_start_cpuid
  if_start_nmsg, which is per-CPU netmsg, is added to ifnet to facilitate
  ifnet.if_start scheduling.  ifq_dispatch() is called by ether_output_frame()
  currently
- Use ifq_classic_ functions, if altq is not enabled
- Fix various device drivers bugs in their if_start implementation
- Add ktr for ifq classic enqueue and dequeue
- Add ktr for ifnet.if_start

Revision 1.44: download - view: text, markup, annotated - select for diffs
Fri Mar 14 09:52:10 2008 UTC (6 years, 5 months ago) by matthias
Branches: MAIN
Diff to: previous 1.43: preferred, unified
Changes since revision 1.43: +77 -21 lines
Introduce two new ioctl(2) commands, BIOCLOCK and BIOCSETWF. These commands
enhance the security of bpf(4) by further relinquishing the privilege of
the bpf(4) consumer (assuming the ioctl commands are being implemented).

This change is needed to properly support some programs from OpenBSD, such
as pflogd and dhclient.

Reviewed-by: sephe@
Obtained-from: OpenBSD via FreeBSD

Revision 1.43: download - view: text, markup, annotated - select for diffs
Wed Jan 2 12:30:34 2008 UTC (6 years, 7 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12
Diff to: previous 1.42: preferred, unified
Changes since revision 1.42: +1 -1 lines
Add more sanity checks in bpf_validate():
- BPF programs with no instructions or with more than BPF_MAXINSNS
  instructions.
- BPF_STX and BPF_LDX|BPF_MEM instructions that have out-of-range offsets
  (which could be made to fetch or store into arbitrary memory locations).
- BPF_DIV instructions with a constant 0 divisor (that's a check also done
  at run time).

Submitted-by: Guy Harris <guy@alum.mit.edu>
Obtained-from:
    OpenBSD (with additional comments and modification from the submitter)

Revision 1.42: download - view: text, markup, annotated - select for diffs
Sat Oct 13 09:53:51 2007 UTC (6 years, 10 months ago) by sephe
Branches: MAIN
Diff to: previous 1.41: preferred, unified
Changes since revision 1.41: +3 -0 lines
Shut up gcc41 warnings by clearing return values before doing any further
processing in bpf_movein()

Revision 1.41: download - view: text, markup, annotated - select for diffs
Mon Aug 27 16:15:42 2007 UTC (6 years, 11 months ago) by hasso
Branches: MAIN
Diff to: previous 1.40: preferred, unified
Changes since revision 1.40: +0 -5 lines
Nuke FDDI support.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Mon Feb 12 15:02:33 2007 UTC (7 years, 6 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10
Diff to: previous 1.39: preferred, unified
Changes since revision 1.39: +23 -20 lines
- Replace 0 with NULL when pointers are tested.
- Break long line.
- Style(9) for 'if' statement.
- Correct bpf_freed() function comment.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Feb 12 14:05:13 2007 UTC (7 years, 6 months ago) by sephe
Branches: MAIN
Diff to: previous 1.38: preferred, unified
Changes since revision 1.38: +1 -9 lines
- Prefer m_getl()
- Nuke blank line

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sun Feb 11 12:10:04 2007 UTC (7 years, 6 months ago) by sephe
Branches: MAIN
Diff to: previous 1.37: preferred, unified
Changes since revision 1.37: +9 -12 lines
- Rename reset_d() to bpf_resetd() just like other function which operates
  on bpf_d
- Use m_lengthm()
- Nuke tab on blank line

Revision 1.35.2.1: download - view: text, markup, annotated - select for diffs
Sun Feb 11 11:32:03 2007 UTC (7 years, 6 months ago) by sephe
Branches: DragonFly_RELEASE_1_8
CVS tags: DragonFly_RELEASE_1_8_Slip
Diff to: previous 1.35: preferred, unified; next MAIN 1.36: preferred, unified
Changes since revision 1.35: +1 -0 lines
MFC bpf.c rev1.37:
In bpf_ptap(), duplicate incoming mbuf's m_pkthdr.rcvif, so !bpf_d.bd_seesent
will be handled correctly in bpf_mtap().

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sun Feb 11 11:30:05 2007 UTC (7 years, 6 months ago) by sephe
Branches: MAIN
Diff to: previous 1.36: preferred, unified
Changes since revision 1.36: +1 -0 lines
In bpf_ptap(), duplicate incoming mbuf's m_pkthdr.rcvif, so !bpf_d.bd_seesent
will be handled correctly in bpf_mtap().

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sun Feb 11 10:23:29 2007 UTC (7 years, 6 months ago) by sephe
Branches: MAIN
Diff to: previous 1.35: preferred, unified
Changes since revision 1.35: +0 -7 lines
kmalloc(M_WAITOK) will not return NULL

Revision 1.35: download - view: text, markup, annotated - select for diffs
Fri Dec 22 23:44:54 2006 UTC (7 years, 8 months ago) by swildner
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_8
Diff to: previous 1.34: preferred, unified
Changes since revision 1.34: +1 -1 lines
Rename printf -> kprintf in sys/ and add some defines where necessary
(files which are used in userland, too).

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun Sep 10 01:26:39 2006 UTC (7 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.33: preferred, unified
Changes since revision 1.33: +6 -6 lines
Change the kernel dev_t, representing a pointer to a specinfo structure,
to cdev_t.  Change struct specinfo to struct cdev.  The name 'cdev' was taken
from FreeBSD.  Remove the dev_t shim for the kernel.

This commit generally removes the overloading of 'dev_t' between userland and
the kernel.

Also fix a bug in libkvm where a kernel dev_t (now cdev_t) was not being
properly converted to a userland dev_t.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Sep 5 00:55:46 2006 UTC (7 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.32: preferred, unified
Changes since revision 1.32: +14 -14 lines
Rename malloc->kmalloc, free->kfree, and realloc->krealloc.  Pass 1

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sun Jul 30 09:39:27 2006 UTC (8 years ago) by sephe
Branches: MAIN
Diff to: previous 1.31: preferred, unified
Changes since revision 1.31: +24 -7 lines
Rather than calling mircotime() in catchpacket(), make catchpacket()
take a timeval indicating when the packet was captured. Move
microtime() to the calling functions and grab the timestamp as soon
as we know that we're going to call catchpacket at least once.

This means that we call microtime() once per matched packet, as
opposed to once per matched packet per bpf listener. It also means
that we return the same timestamp to all bpf listeners, rather than
slightly different ones.

It would be more accurate to call microtime() even earlier for all
packets, but microtime() can be costly, so this didn't seem like a good idea.

Obtained-from: FreeBSD (dwmalone@freebsd.org)
Remined-and-Reviewed-by: joerg

Revision 1.31: download - view: text, markup, annotated - select for diffs
Fri Jul 28 02:17:40 2006 UTC (8 years ago) by dillon
Branches: MAIN
Diff to: previous 1.30: preferred, unified
Changes since revision 1.30: +66 -70 lines
MASSIVE reorganization of the device operations vector.  Change cdevsw
to dev_ops.  dev_ops is a syslink-compatible operations vector structure
similar to the vop_ops structure used by vnodes.

Remove a huge number of instances where a thread pointer is still being
passed as an argument to various device ops and other related routines.
The device OPEN and IOCTL calls now take a ucred instead of a thread pointer,
and the CLOSE call no longer takes a thread pointer.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Jun 13 08:12:03 2006 UTC (8 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.29: preferred, unified
Changes since revision 1.29: +0 -3 lines
Add kernel syscall support for explicit blocking and non-blocking I/O
regardless of the setting applied to the file pointer.

send/sendmsg/sendto/recv/recvmsg/recfrom: New MSG_ flags defined in
sys/socket.h may be passed to these functions to override the settings
applied to the file pointer on a per-I/O basis.

MSG_FBLOCKING	- Force the operation to be blocking
MSG_FNONBLOCKING- Force the operation to be non-blocking

pread/preadv/pwrite/pwritev: These system calls have been renamed and
wrappers will be added to libc.  The new system calls are prefixed with
a double underscore (like getcwd vs __getcwd) and include an additional
flags argument.  The new flags are defined in sys/fcntl.h and may be
used to override settings applied to the file pointer on a per-I/O basis.

Additionally, the internal __ versions of these functions now accept an
offset of -1 to mean 'degenerate into a read/readv/write/writev' (i.e.
use the offset in the file pointer and update it on completion).

O_FBLOCKING	- Force the operation to be blocking
O_FNONBLOCKING	- Force the operation to be non-blocking
O_FAPPEND	- Force the write operation to append (to a regular file)
O_FOFFSET	- (implied of the offset != -1) - offset is valid
O_FSYNCWRITE	- Force a synchronous write
O_FASYNCWRITE	- Force an asynchronous write
O_FUNBUFFERED	- Force an unbuffered operation (O_DIRECT)
O_FBUFFERED	- Force a buffered operation (negate O_DIRECT)

If the flags do not specify an operation (e.g. neither FBLOCKING or
FNONBLOCKING are set), then the settings in the file pointer are used.

The original system calls will become wrappers in libc, without the flags
arguments.  The new system calls will be made available to libc_r to allow
it to perform non-blocking I/O without having to mess with a descriptor's
file flags.

NOTE: the new __pread and __pwrite system calls are backwards compatible
with the originals due to a pad byte that libc always set to 0.
The new __preadv and __pwritev system calls are NOT backwards compatible,
but since they were added to HEAD just two months ago I have decided
to not renumber them either.

NOTE: The subrev has been bumped to 1.5.4 and installworld will refuse to
install if you are not running at least a 1.5.4 kernel.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Mon Nov 28 17:13:45 2005 UTC (8 years, 8 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_4_Slip, DragonFly_RELEASE_1_4
Diff to: previous 1.28: preferred, unified
Changes since revision 1.28: +8 -2 lines
Make all network interrupt service routines MPSAFE part 1/3.

Replace the critical section that was previously used to serialize access
with the LWKT serializer.  Integrate the serializer into the IFNET structure.
Note that kern.intr_mpsafe must be set to 1 for network interrupts to actually
run MPSAFE.  Also note that any interrupts shared with othre non-MP drivers
will cause all drivers on that interrupt to run with the Big Giant Lock.

Network interrupt - Each network driver then simply passes that serializer
to bus_setup_intr() so only a single serializer is required to process the
entire interrupt path.  LWKT serialization support is already 100% integrated
into the interrupt subsystem so it will already be held as of when the
registered interrupt procedure is called.

Ioctl and if_* functions - All callers of if_* functions (such as if_start,
if_ioctl, etc) now obtain the IFNET serializer before making the call.  Thus
all of these entry points into the driver will now be serialized.

if_input - All code that calls if_input now ensures that the serializer
is held.  It will either already be held (when called from a driver), or
the serializer will be wrapped around the call.  When packets are forwarded
or bridged between interfaces, the target interface serializer will be
dropped temporarily to avoid a deadlock.

Device Driver access - dev_* entry points into certain pseudo-network
devices now obtain and release the serializer.  This had to be done on
a device-by-device basis (but there are only a few such devices).

Thanks to several people for helping test the patch, in particular
Sepherosa Ziehau.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Fri Jul 8 18:19:39 2005 UTC (9 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.27: preferred, unified
Changes since revision 1.27: +3 -1 lines
Add missing m_freem() in BPF if the mbuf exceeds the interface mtu.

Reported-by: Guy Harris <guy@alum.mit.edu>

Revision 1.27: download - view: text, markup, annotated - select for diffs
Fri Jun 3 18:19:51 2005 UTC (9 years, 2 months ago) by swildner
Branches: MAIN
Diff to: previous 1.26: preferred, unified
Changes since revision 1.26: +0 -0 lines
Remove spl*() in net/{altq,bpf.c,bridge,dummynet,ef,gif,gre,hostcache.c}
and replace them with critical sections.

[forced commit to correct message]

Revision 1.26: download - view: text, markup, annotated - select for diffs
Fri Jun 3 18:04:14 2005 UTC (9 years, 2 months ago) by swildner
Branches: MAIN
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +40 -45 lines
Remove spl*() in net/{altq,bpf.c,bridge,dummynet,ef,gif,gre,hostcache.c}
netgraph and replace them with critical sections.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Apr 20 10:22:44 2005 UTC (9 years, 4 months ago) by hmp
Branches: MAIN
CVS tags: DragonFly_Stable
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +11 -0 lines
Add bpf_mtap_family(9) which allows the client to specify an address
family.  The logic is quite repetetive in various psuedo drivers and
other networking subsystems, like netgraph.

In-discussion-with: 	Joerg Sonnenberger.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Thu Mar 31 12:31:31 2005 UTC (9 years, 4 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +1 -1 lines
Fix non-BPF declaration of bpf_ptap, it was out-of-sync with the header.

Reported-by: tcslv@cox.net

Revision 1.23: download - view: text, markup, annotated - select for diffs
Wed Jan 26 16:15:06 2005 UTC (9 years, 6 months ago) by joerg
Branches: MAIN
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +1 -1 lines
Don't build a new mbuf and bpf_mtap the old one.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Wed Jan 26 00:37:39 2005 UTC (9 years, 6 months ago) by joerg
Branches: MAIN
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +169 -28 lines
- Add support for attaching alternative DLTs to an interface.
  The function is named bpfattach_dlt, FreeBSD used bpfattach2.
- Change bpf_mtap to take the bpf_if directly.
- Add support for BIOCSDLT and BIOCGDLT to recieve a list of DLTs
  available on an interface.

Obtained-from: FreeBSD

- Add bpf_ptap, which takes an mbuf and a header, builds a temporary
  mbuf chain and calls bpf_mtap on that.

Inspired-by: FreeBSD's bpf_mtap2

- Use the new interface for all drivers doing this by hand before.
- Include the formerly commented out support for radio headers in wi(4)
  and wlan(4).
- Change if_loop, i4b_ipr, disc and ic to prepend a uint32_t, not an int.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Thu Jan 6 09:14:13 2005 UTC (9 years, 7 months ago) by hsu
Branches: MAIN
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +6 -6 lines
Cosmetic cleanups.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Dec 21 02:54:14 2004 UTC (9 years, 8 months ago) by hsu
Branches: MAIN
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +43 -51 lines
Clean up the routing and networking code before I parallelize routing.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed Jul 7 15:16:04 2004 UTC (10 years, 1 month ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004, DragonFly_1_0_REL, DragonFly_1_0A_REL
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +122 -274 lines
Welcome BPF in the 21st century and remove all the pre-ANSI C, BSD < 1991
junk. Fix some small style(9) glitches and change some pointer comparisions
to use explicit NULL. Use ISO C protyps.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Wed Jun 2 14:42:57 2004 UTC (10 years, 2 months ago) by eirikn
Branches: MAIN
CVS tags: DragonFly_1_0_RC1
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +2 -2 lines
Change mbug allocation flags from M_ to MB_ to avoid confusion with malloc
flags.

Requested by: Jeffrey Hsu

Revision 1.17: download - view: text, markup, annotated - select for diffs
Wed May 19 22:52:59 2004 UTC (10 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +2 -4 lines
Device layer rollup commit.

* cdevsw_add() is now required.  cdevsw_add() and cdevsw_remove() may specify
  a mask/match indicating the range of supported minor numbers.  Multiple
  cdevsw_add()'s using the same major number, but distinctly different
  ranges, may be issued.  All devices that failed to call cdevsw_add() before
  now do.

* cdevsw_remove() now automatically marks all devices within its supported
  range as being destroyed.

* vnode->v_rdev is no longer resolved when the vnode is created.  Instead,
  only v_udev (a newly added field) is resolved.  v_rdev is resolved when
  the vnode is opened and cleared on the last close.

* A great deal of code was making rather dubious assumptions with regards
  to the validity of devices associated with vnodes, primarily due to
  the persistence of a device structure due to being indexed by (major, minor)
  instead of by (cdevsw, major, minor).  In particular, if you run a program
  which connects to a USB device and then you pull the USB device and plug
  it back in, the vnode subsystem will continue to believe that the device
  is open when, in fact, it isn't (because it was destroyed and recreated).

  In particular, note that all the VFS mount procedures now check devices
  via v_udev instead of v_rdev prior to calling VOP_OPEN(), since v_rdev
  is NULL prior to the first open.

* The disk layer's device interaction has been rewritten.  The disk layer
  (i.e. the slice and disklabel management layer) no longer overloads
  its data onto the device structure representing the underlying physical
  disk.  Instead, the disk layer uses the new cdevsw_add() functionality
  to register its own cdevsw using the underlying device's major number,
  and simply does NOT register the underlying device's cdevsw.  No
  confusion is created because the device hash is now based on
  (cdevsw,major,minor) rather then (major,minor).

  NOTE: This also means that underlying raw disk devices may use the entire
  device minor number instead of having to reserve the bits used by the disk
  layer, and also means that can we (theoretically) stack a fully
  disklabel-supported 'disk' on top of any block device.

* The new reference counting scheme prevents this by associating a device
  with a cdevsw and disconnecting the device from its cdevsw when the cdevsw
  is removed.  Additionally, all udev2dev() lookups run through the cdevsw
  mask/match and only successfully find devices still associated with an
  active cdevsw.

* Major work on MFS:  MFS no longer shortcuts vnode and device creation.  It
  now creates a real vnode and a real device and implements real open and
  close VOPs.  Additionally, due to the disk layer changes, MFS is no longer
  limited to 255 mounts.  The new limit is 16 million.  Since MFS creates a
  real device node, mount_mfs will now create a real /dev/mfs<PID> device
  that can be read from userland (e.g. so you can dump an MFS filesystem).

* BUF AND DEVICE STRATEGY changes.  The struct buf contains a b_dev field.
  In order to properly handle stacked devices we now require that the b_dev
  field be initialized before the device strategy routine is called.  This
  required some additional work in various VFS implementations.  To enforce
  this requirement, biodone() now sets b_dev to NODEV.  The new disk layer
  will adjust b_dev before forwarding a request to the actual physical
  device.

* A bug in the ISO CD boot sequence which resulted in a panic has been fixed.

Testing by: lots of people, but David Rhodus found the most aggregious bugs.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Thu May 13 23:49:24 2004 UTC (10 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +1 -1 lines
device switch 1/many: Remove d_autoq, add d_clone (where d_autoq was).

d_autoq was used to allow the device port dispatch to mix old-style synchronous
calls with new style messaging calls within a particular device.  It was never
used for that purpose.

d_clone will be more fully implemented as work continues.  We are going to
install d_port in the dev_t (struct specinfo) structure itself and d_clone
will be needed to allow devices to 'revector' the port on a minor-number
by minor-number basis, in particular allowing minor numbers to be directly
dispatched to distinct threads.  This is something we will be needing later
on.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Thu Apr 22 04:21:29 2004 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +2 -3 lines
M_NOWAIT -> M_WAITOK or M_INTWAIT conversions.  There is a whole lot of net
code that is improperly using M_NOWAIT.  Also remove now unneeded NULL checks
since malloc will panic rather then return NULL when M_NULLOK is not set.

Use M_INTWAIT|M_NULLOK in some cases (such as route table allocation) in
order to allow malloc to return NULL when the limit for the malloc type
is reached.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue Mar 23 22:19:05 2004 UTC (10 years, 5 months ago) by hsu
Branches: MAIN
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +2 -1 lines
Eliminate use of curthread in if_ioctl functions by passing down the
ucred structure.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Tue Mar 9 14:57:18 2004 UTC (10 years, 5 months ago) by hmp
Branches: MAIN
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +1 -1 lines
Fix violating usage of M_DONTWAIT in calls to malloc() by replacing
them with M_NOWAIT.

Submitted by:	Craig Dooley <craig@xlnx-x.net>

Revision 1.12: download - view: text, markup, annotated - select for diffs
Tue Feb 24 18:41:57 2004 UTC (10 years, 6 months ago) by joerg
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +1 -1 lines
Use ovbcopy instead of bcopy to match prototyp

Revision 1.11: download - view: text, markup, annotated - select for diffs
Fri Feb 13 17:45:49 2004 UTC (10 years, 6 months ago) by joerg
Branches: MAIN
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +2 -2 lines
Add __DragonFly__

Revision 1.10: download - view: text, markup, annotated - select for diffs
Wed Jan 7 11:04:19 2004 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +1 -1 lines
tvtohz() was originally designed for tsleep() and timeout() operations but
it is also used to time nanosleep() ops.  The problem is that in order to
compensate for the fact that a clock interrupt might occur just after a
thread blocks or registers a timeout, this function effectively added +1
to the returned value plus added another +1 for timeouts that were not
integer multiples if the clock interrupt frequency.

Split tvtohz() into two routines: tvtohz_low() and tvtohz_high().
tvtohz_low() does not do any compensation, tvtohz_high() does.

Add the kern.sleep_hardloop sysctl, which defaults to 0 (off).  If set to
1 this will cause nanosleep() to attempt to time exactly the requested
interval (which could cost more cpu) rather then rounding it off to a
multiple of hz.  If set to 2 nanosleep() will only do the more rigid
timing for requests less then 1 second.   Also change the normal hz-baesd
case to only compensate by +1, not +2, in order to improve accuracy.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Tue Jan 6 03:17:25 2004 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +4 -5 lines
if_xname support Part 2/2: Convert remaining netif devices and implement full
support for if_xname.  Restructure struct ifnet in net/if_var.h, pulling in
a few minor additional changes from current including making if_dunit an int,
and making if_flags an int.

Submitted-by: Max Laier <max@love2party.net>

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Aug 26 20:49:47 2003 UTC (10 years, 11 months ago) by rob
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +16 -16 lines
__P() removal

Revision 1.7: download - view: text, markup, annotated - select for diffs
Thu Aug 7 21:17:24 2003 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +1 -1 lines
kernel tree reorganization stage 1: Major cvs repository work (not logged as
commits) plus a major reworking of the #include's to accomodate the
relocations.

    * CVS repository files manually moved.  Old directories left intact
      and empty (temporary).

    * Reorganize all filesystems into vfs/, most devices into dev/,
      sub-divide devices by function.

    * Begin to move device-specific architecture files to the device
      subdirs rather then throwing them all into, e.g. i386/include

    * Reorganize files related to system busses, placing the related code
      in a new bus/ directory.  Also move cam to bus/cam though this may
      not have been the best idea in retrospect.

    * Reorganize emulation code and place it in a new emulation/ directory.

    * Remove the -I- compiler option in order to allow #include file
      localization, rename all config generated X.h files to use_X.h to
      clean up the conflicts.

    * Remove /usr/src/include (or /usr/include) dependancies during the
      kernel build, beyond what is normally needed to compile helper
      programs.

    * Make config create 'machine' softlinks for architecture specific
      directories outside of the standard <arch>/include.

    * Bump the config rev.

    WARNING! after this commit /usr/include and /usr/src/sys/compile/*
    should be regenerated from scratch.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Jul 26 20:19:33 2003 UTC (11 years, 1 month ago) by rob
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +35 -35 lines
Register keyword removal

Approved by: Matt Dillon

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Jul 21 05:50:43 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +7 -5 lines
DEV messaging stage 1/4: Rearrange struct cdevsw and add a message port
and auto-queueing mask.  The mask will tell us which message functions
can be safely queued to another thread and which still need to run in the
context of the caller.   Primary configuration fields (name, cmaj, flags,
port, autoq mask) are now at the head of the structure.  Function vectors,
which may eventually go away, are at the end.  The port and autoq fields
are non-functional in this stage.

The old BDEV device major number support has also been removed from cdevsw,
and code has been added to translate the bootdev passed from the boot code
(the boot code has always passed the now defunct block device major numbers
and we obviously need to keep that compatibility intact).

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Jul 19 21:14:43 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +2 -3 lines
Remove the priority part of the priority|flags argument to tsleep().  Only
flags are passed now.  The priority was a user scheduler thingy that is not
used by the LWKT subsystem.  For process statistics assume sleeps without
P_SINTR set to be disk-waits, and sleeps with it set to be normal sleeps.

This commit should not contain any operational changes.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon Jun 23 17:55:45 2003 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +15 -24 lines
proc->thread stage 2: MAJOR revamping of system calls, ucred, jail API,
and some work on the low level device interface (proc arg -> thread arg).
As -current did, I have removed p_cred and incorporated its functions
into p_ucred.  p_prison has also been moved into p_ucred and adjusted
accordingly.  The jail interface tests now uses ucreds rather then processes.

The syscall(p,uap) interface has been changed to just (uap).  This is inclusive
of the emulation code.  It makes little sense to pass a proc pointer around
which confuses the MP readability of the code, because most system call code
will only work with the current process anyway.  Note that eventually
*ALL* syscall emulation code will be moved to a kernel-protected userland
layer because it really makes no sense whatsoever to implement these
emulations in the kernel.

suser() now takes no arguments and only operates with the current process.
The process argument has been removed from suser_xxx() so it now just takes
a ucred and flags.

The sysctl interface was adjusted somewhat.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 04:28:47 2003 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.1: preferred, unified
Changes since revision 1.1: +1 -0 lines
Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids.  Most
ids have been removed from !lint sections and moved into comment sections.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jun 17 02:55:25 2003 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
import from FreeBSD RELENG_4 1.59.2.12

Diff request

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

Log view options