DragonFly BSD

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

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.49: download - view: text, markup, annotated - select for diffs
Sat Nov 1 10:29:31 2008 UTC (5 years, 10 months ago) by sephe
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.48: preferred, unified
Changes since revision 1.48: +5 -5 lines
Use the same indentation as the rest of the functions in this file.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Mon Oct 27 02:56:30 2008 UTC (5 years, 10 months ago) by sephe
Branches: MAIN
Diff to: previous 1.47: preferred, unified
Changes since revision 1.47: +7 -0 lines
pr_ctlinput is usually called when certains types of ICMP packets are received.
However, the processing of ICMP packets happens in netisr0, which means the
thread context, in which pr_ctlinput is called, is not correct.  To handle this
following two fixes are applied:
- Add pr_ctlport to protosw and ip6protosw, which could be used to locate
  correct msgport to call pr_ctlinput for specific protocol
- All necessary information needed by pr_ctlinput are gather into one netmsg,
  and this netmsg is delivered synchronously (some information is on the stack)

Note for new protocol implementation:
pr_ctlinput and pr_ctlport should be both NULL or both non-NULL.

Obtained-from: dillon@
Tested-by: pavalos@

Revision 1.47: download - view: text, markup, annotated - select for diffs
Thu Sep 25 12:08:51 2008 UTC (5 years, 11 months ago) by sephe
Branches: MAIN
Diff to: previous 1.46: preferred, unified
Changes since revision 1.46: +23 -10 lines
Add NETISR_TO_MSGF() to convert netisr.ni_flags to lwkt_msg.ms_flags to
avoid potential tranlation bugs

Pointed-out-by: hsu@

Revision 1.46: 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
Diff to: previous 1.45: preferred, unified
Changes since revision 1.45: +91 -18 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.45: download - view: text, markup, annotated - select for diffs
Sat Sep 20 04:31:02 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.44: preferred, unified
Changes since revision 1.44: +1 -1 lines
Add TDF_NETWORK lwkt flag, so various assertion could be performed to make sure
that packets are processed in network threads (i.e. controlled enviroment)

Revision 1.44: download - view: text, markup, annotated - select for diffs
Wed Sep 17 07:24:18 2008 UTC (6 years ago) by sephe
Branches: MAIN
Diff to: previous 1.43: preferred, unified
Changes since revision 1.43: +0 -33 lines
Nuke unused function

Revision 1.43: download - view: text, markup, annotated - select for diffs
Mon Jun 23 11:57:19 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0, DragonFly_Preview
Diff to: previous 1.42: preferred, unified
Changes since revision 1.42: +51 -0 lines
Add ether_input_chain2() which could be called by ethernet NIC drivers to
deliver packets into upper layer.  Unlike ether_input_chain(), this function
only locates the msgport for the input packets, rest of the functionalities
of ether_input_chain() are performed in the protocal threads, i.e. after
packets reaches target msgports.  This function and other related functions
are put under kernel option ETHER_INPUT2, which is _not_ enabled by default.
As of this commit, vlan(4) and ipflow don't work with ether_input_chain2().

em(4) is adapted to aware ETHER_INPUT2.

Reviewed-by: dillon@, aggelos@ (early version)

# Additional comments are added to the the reviewed patch.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Sat Jun 21 05:55:46 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.41: preferred, unified
Changes since revision 1.41: +4 -4 lines
Use __func__, instead of hardcode the function name.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun Jun 1 07:43:29 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.40: preferred, unified
Changes since revision 1.40: +1 -6 lines
Avoid code duplication

Revision 1.40: download - view: text, markup, annotated - select for diffs
Fri May 2 07:40:32 2008 UTC (6 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.39: preferred, unified
Changes since revision 1.39: +33 -0 lines
Introduce ETHER_INPUT_CHAIN option:
1) During RXEOF, we aggregate packets, which have same target CPU, instead of
   calling lwkt_sendmsg() for each input packet.
2) At the end of RXEOF, low level ipiq sending is used to dispatch mbuf chain
   to the target CPU.
3) On the target CPU, the ipi function puts mbuf to their belonging msgport.
   Note, though lwkt_sendmsg() is used in ipi function, no further ipi activity
   will happen, since we are on target CPU.

em(4) is made to aware of this option.
This option is off by default and has no effect on vlan(4) operation.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Sat Mar 29 04:45:47 2008 UTC (6 years, 5 months ago) by sephe
Branches: MAIN
Diff to: previous 1.38: preferred, unified
Changes since revision 1.38: +7 -2 lines
Add two tunables to run netisr and udp_thread without mplock, so experiment
could be conducted under controlled environment.
Default values of these two tunables are to run netisr/udp_thread with mplock.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sat Mar 29 03:37:15 2008 UTC (6 years, 5 months ago) by sephe
Branches: MAIN
Diff to: previous 1.37: preferred, unified
Changes since revision 1.37: +15 -0 lines
Add MPSAFE version of netmsg_service_loop()

Revision 1.37: download - view: text, markup, annotated - select for diffs
Fri Mar 7 11:34:19 2008 UTC (6 years, 6 months ago) by sephe
Branches: MAIN
Diff to: previous 1.36: preferred, unified
Changes since revision 1.36: +1 -1 lines
Parallelize ifnet.if_addrhead accessing by duplicating the list itself
on each CPU, each list element points to ifaddr:
- Add SI_SUB_PRE_DRIVERS before SI_SUB_DRIVERS, so action could be taken
  before drivers' initialization (mainly before NIC driver's if_attach())
- Move netisr_init() to the FIRST of SI_SUB_PRE_DRIVERS, so that
  netmsg_service_port_init() could be called in earlier stage of system
  initialization.
- Create one thread on each CPU to propagate changes to ifnet.if_addrhead.
  Their thread ports are registered with netmsg_service_port_init() for
  port syncing operation.
- Change to ifnet.if_addrhead begins in netisr0, i.e. serial of changes
  to ifnet.if_addrhead are serialized by netisr0
- ifaddr's refcnt is moved to its list elements, i.e. per-CPU refcnt.
  They are initialized to 1 instead of 0.
- A magic field is added to ifaddr list element to make sure that IFAREF
  and IFAFREE are called on valid ifaddr list element.  This field is
  initialized to a magic value and is wiped out once the list element's
  refcnt drops to 0
- To close the gap between testing and freeing, once the ifaddr list
  element's refcnt drops to 0, ifa_portfn(0) (a thread's port on CPU0) is
  poked to check whether ifaddr is referenced on other CPUs, if not, then
  ifaddr is freed on ifa_portfn(0)

Reviewed-by: dillon@ (earlier version)

Revision 1.36: download - view: text, markup, annotated - select for diffs
Wed Dec 19 11:00:22 2007 UTC (6 years, 9 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12
Diff to: previous 1.35: preferred, unified
Changes since revision 1.35: +2 -2 lines
Make divert(4) socket dispatch mbuf to correct the lwkt port for further
processing (ip_{input,output}):
- Add mbuf** function parameter to protosw.pr_mport()
- Pass 'addr' to pr_mport() in so_pru_send(); udp_soport() is adjusted
  accordingly
- Add additional parameter to ip_mport(), so it could be called with both
  incoming and outgoing packets.  And the processing for outgoing UDP packets
  matches udp_soport()
- Add div_soport() as IPPROTO_DIVERT's pr_mport()
  o  Delegate non-PRU_SEND operation to cpu0_soport()
  o  Move receiving interface setting up code from div_output() into this
     function, so ip_mport() could be called
  o  Use ip_mport() to find the target lwkt port

Revision 1.35: download - view: text, markup, annotated - select for diffs
Tue Jul 10 20:24:57 2007 UTC (7 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10
Diff to: previous 1.34: preferred, unified
Changes since revision 1.34: +3 -9 lines
Do not synchronously waitmsg in the unix domain socket's custom putport
function.  This prevents us from being able to abort an accept() when
a process takes a signal.

Clean up some other stuff.  MSGF_DONE should already be clear.

Reported-by: Peter Avalos <pavalos@theshell.com>

Revision 1.34: download - view: text, markup, annotated - select for diffs
Thu May 31 11:00:25 2007 UTC (7 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.33: preferred, unified
Changes since revision 1.33: +1 -2 lines
Catch up with the latest LWKT msgport updating.

Reviewed-by: dillon@

Revision 1.33: download - view: text, markup, annotated - select for diffs
Thu May 24 20:51:21 2007 UTC (7 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.32: preferred, unified
Changes since revision 1.32: +2 -2 lines
Add lwkt_sleep() to formalize a shortcut numerous bits of code have been
using for a while, which is to directly deschedule oneself and switch away.
This method of blocking requires a direct lwkt_schedule() call to reschedule
the thread and is primarily used by the message port abstraction.

Change the psignal code to check TDF_SINTR in the thread flags instead
of checking MSGPORTF_WAITING in the thread's private message port.

The lwkt_waitmsg() and lwkt_waitport() functions use the same msgport
backend function (mp_waitport).  Separate the backend into two functions,
mp_waitport and mp_waitmsg, and allow tsleep flags to be passed in instead
of flagging interruptability in the lwkt_msg flags.

Optimize the lwkt_waitmsg() backends - in the fully synchronous critical
path case no critical sections or spinlocks are required at all.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Thu May 24 05:51:29 2007 UTC (7 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.31: preferred, unified
Changes since revision 1.31: +19 -24 lines
LWKT message ports contain a number of function pointers which abstract
their backend operation.

* Add a new function, mp_getport(), which takes over the functionality
  of lwkt_getport().

* Formalize the default backend and rename it the 'thread' port backend, used
  when a message port will only be drained by a single thread.  This backend
  is able to use critical sections and IPI messages to handle races.

* Fix a small timing window in the thread port backend where replying a
  synchronous message request from a different cpu may fail to wake up
  the originator who is waiting for the message completion.

* Abstract-out the message port initialization code and clean up related
  code pollution.

* Add a new backend called the 'spin' port backend.  This backend can be
  used if a message port might be drained by several different threads.
  For example, this would allow us to use a message port as part of a
  file pointer / file descriptor construct.

* Add a boot-time tunable, lwkt.use_spin_port (defaults to off) which
  forces spin ports to be used instead of thread ports for the per-thread
  message port.  This is used only for debugging.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Wed May 23 08:57:10 2007 UTC (7 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.30: preferred, unified
Changes since revision 1.30: +18 -33 lines
* Greatly reduce the complexity of the LWKT messaging and port abstraction.
  Significantly reduce the overhead of the subsystem.

* The message abort algorithm has been rewritten.  It now sends a
  separate message to issue the abort instead of trying to requeue
  the original message.  This also means the TAILQ embedded in the
  lwkt_msg structure can be used by unrelated code during processing
  of the message.

* Numerous MSGF_ flags have been removed, and all the LWKT msg/port
  algorithms have been rewritten and simplified.  The message structure
  is now only touched by the current owner in all situations.

* Numerous structural fields have been removed.  In particular, the
  fields used for message abort sequencing have been simplified and
  we do not try to embed a 'command' field in the base LWKT message
  any more.

* Clean up the netmsg abstraction, which is used all over the network stack.
  Instead of trying to overload fields in lwkt_msg we now simply extend
  the base lwkt_msg into struct netmsg.  The function dispatch now takes
  a netmsg and returns void (before we had to return EASYNC), and we no
  longer need weird casts.

  Accept/connect message aborts are now greatly simplified.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sun Mar 4 18:51:59 2007 UTC (7 years, 6 months ago) by swildner
Branches: MAIN
Diff to: previous 1.29: preferred, unified
Changes since revision 1.29: +0 -17 lines
Remove weird license clause which has expired.

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

Revision 1.28: download - view: text, markup, annotated - select for diffs
Tue Nov 7 18:50:07 2006 UTC (7 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.27: preferred, unified
Changes since revision 1.27: +0 -1 lines
Remove system dependancies on <machine/ipl.h>.  Only architecture files
need it now.  SWI_* defines moved from the MD <machine/ipl.h> to the
MI <sys/interrupt.h> directory.

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

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sat May 20 06:32:37 2006 UTC (8 years, 4 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +14 -5 lines
Embed the netmsg in the mbuf itself rather than allocating one for
each received packet.  This greatly reduces the overhead in the
network receive path (removing a malloc() and free()).

Revision 1.25: download - view: text, markup, annotated - select for diffs
Tue Jan 31 19:05:35 2006 UTC (8 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +6 -0 lines
Bring in the parallel route table code and clean up ARP.  The
route table is now replicated across all cpus (ncpus, not ncpus2).
Note that cloned routes are not replicated.

This removes one of the few remaining obstacles to being able
to run the network protocol stacks without the BGL.

Primary-Design-by: Jeffrey Hsu
Work-by: Jeffrey Hsu and Matthew Dillon

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sat Jan 14 11:05:17 2006 UTC (8 years, 8 months ago) by swildner
Branches: MAIN
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +1 -2 lines
* Remove (void) casts for discarded return values.

* Put function types on separate lines.

* Ansify function definitions.

In-collaboration-with: Alexey Slynko <slynko@tronet.ru>

Revision 1.23: download - view: text, markup, annotated - select for diffs
Wed Jan 19 17:30:52 2005 UTC (9 years, 8 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_4_Slip, DragonFly_RELEASE_1_4, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +78 -3 lines
When a PCMCIA networking card is removed the IF code may free() the network
interface before processing has completed on pending packets, leaving a
dangling pointer in the mbuf and causing a crash.

The two solutions are to either ref-count the network interface on a
per-packet basis or to synchronize against consumers of the packet.
ref-counting is very expensive in an MP system so we have chosen to
synchronize against consumers by sending a NOP message to all protocol
processing threads and waiting for it to be replied.  This only occurs when
an interface is being brought down and is not expected to introduce any
performance issues.

Crash-Reported-by: Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Sep 10 18:23:56 2004 UTC (10 years ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +1 -10 lines
Implement a convenient lwkt_initport_null_rport() call which initializes
a message port with a non-queueing sink-null replyport rather then a default
replyport, rather then rolling our own in the net code and other places where
we may need it.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun Jul 18 16:26:41 2004 UTC (10 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +2 -2 lines
Fix two serious bugs in the IP demux code.  First, if ip_mport() m_pullup()'s
an mbuf, the new/modified mbuf is not returned to the caller and the caller
may wind up using a stale/freed mbuf.  Second, ip_mport() was not consistently
freeding mbufs which could lead to both a memory leak and a double free.

Reported-by: YONETANI Tomokazu <qhwt+dragonfly-bugs@les.ath.cx> (panic: TCP header not in one mbuf).

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri Jul 16 05:48:08 2004 UTC (10 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +3 -0 lines
Note that Jeff indicated to me that Jonathan Lemon gave his permission to
merge his copyright into the DFly standard copyright.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Thu Jul 8 22:07:34 2004 UTC (10 years, 2 months ago) by hsu
Branches: MAIN
CVS tags: DragonFly_1_0_REL, DragonFly_1_0A_REL
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +50 -4 lines
Add the standard DragonFly copyright notice to go along with mine.

Approved by:	Matt

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sun Jun 27 19:40:14 2004 UTC (10 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_1_0_RC1
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +53 -13 lines
The schednetisr() routine is supposed to be MP and interrupt safe, but wasn't
because it allocated its messages.  Instead of allocating a message use a
fixed message in the netisr structure.

Get rid of #ifdef SMP/#error.  DEVICE_POLLING now works on SMP builds.

Implement an emergency polling enable function to try to keep the system
operational in a degraded state if interrupt routing is blown.  NOTE: only
vr0 uses the feature at the moment, and DEVICE_POLLING must be enabled.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Mon Jun 7 07:01:36 2004 UTC (10 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +65 -1 lines
Recent accept() changes started depending on the protosw->pr_mport field
being non-NULL, but unix domain sockets still used a NULL pr_mport field.
This was causing e.g. XFree86 to panic the system.

Unix domain socket calls must still be executed synchronously in the context
of the originating process in order to access the proc structure (for ucred
and other things).

Implement a special synchronous port (netisr_sync_port) and hook function
for the protosw called sync_soport() and hook it into the unix domain
socket protosw.  This port executes netmsg's synchronously and also supports
aborts for predicate messages (used by connect and accept).

The atm protosw also specified NULL which we change to the standard
cpu0_soport().

Remove previous workaround code for NULL mports, since we no longer have
any NULL mports.  Remove an assertion in connect2() that was designed to
detect mis-programmed use of the UNIX DOMAIN socket protosw structure.

Original-problem-reported-by: David Rhodus

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Apr 24 06:55:57 2004 UTC (10 years, 5 months ago) by hsu
Branches: MAIN
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +26 -0 lines
The default protocol threads also need the check for
same thread synchronous execution.

Reported by:	YONETANI Tomokazu <qhwt+dragonfly-bugs@les.ath.cx>

Revision 1.15: download - view: text, markup, annotated - select for diffs
Fri Apr 23 10:21:08 2004 UTC (10 years, 5 months ago) by hsu
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +2 -1 lines
Pass more information down to the protocol-specific socket dispatch function
to use if desired.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Wed Apr 21 18:13:51 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +6 -6 lines
Fix a netmsg memory leak in the ARP code.  Adjust all ms_cmd function
dispatches to return a proper error code.

Reported-by: multiple people

Revision 1.13: download - view: text, markup, annotated - select for diffs
Tue Apr 20 01:52:26 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +5 -5 lines
Revamp the initial lwkt_abortmsg() support to normalize the abstraction.  Now
a message's primary command is always processed by the target even if an
abort is requested before the target has retrieved the message from the
message port.  The message will then be requeued and the abort command copied
into lwkt_msg_t->ms_cmd.  Thus the target is always guarenteed to see the
original message and then a second, abort message (the same message with
ms_cmd = ms_abort) regardless of whether the abort was requested before
or after the target retrieved the original message.

ms_cmd is now an opaque union.  LWKT makes no assumptions as to its contents.
The NET code now stores nm_handler in ms_cmd as a function vector, and
nm_handler has been removed from all netmsg structures.

The ms_cmd function vector support nominally returns an integer error code
which is intended to support synchronous/asynchronous optimizations in the
future (to bypass messaging queueing and dequeueing in those situations
where they can be bypassed, without messing up the messaging abstraction).

The connect() predicate for which signal/abort support was added in the last
commit now uses the new abort mechanism.  Instead of having the handler
function check whether a message represents an abort or not, a different
handler vector is stored in ms_abort and run when an abort is processed
(making for an easy separation of function).

The large netmsg switch has been replaced by individual function vectors
using the new ms_cmd function vector support.  This will soon be removed
entirely in favor of direct assignment of LWKT-aware PRU vectors to the
messages command vector.

NOTE ADDITIONAL: eventually the SYSCALL, VFS, and DEV interfaces will use
the new message opaque ms_cmd 'function vector' support instead of a
command index.

Work by: Matthew Dillon and Jeffrey Hsu

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Apr 17 00:46:28 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +1 -2 lines
netisr_queue() needs to reliably allocate the message used to reference the
mbuf so make the allocation M_WAITOK instead of M_NOWAIT.  This also fixes
an mbuf leak due to some users of netisr_queue() not checking the return
value.  Note, however, that there were and still are issues with
netisr_queue() blocking (due to occassionally waiting on kernel_map,
possible deadlock issues, and so forth).

Revision 1.11: download - view: text, markup, annotated - select for diffs
Fri Apr 9 22:34:09 2004 UTC (10 years, 5 months ago) by hsu
Branches: MAIN
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +2 -26 lines
Push the lwkt_replymsg() up one level from netisr_service_loop() to
the message handler so we can explicitly reply or not reply as appropriate.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Mon Apr 5 18:53:03 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +23 -2 lines
Subsystems which install an so_upcall may themselves call socket functions
from the handler thread, which can lead to deadlocks in lwkt_domsg().

Have the netmsg service loop install its own mp_putport() function which
checks for self-referential messages (curthread == port->mp_td) and executes
them synchronously.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sat Mar 6 19:40:30 2004 UTC (10 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +23 -7 lines
Simplify LWKT message initialization semantics to reduce API confusion.

Cleanup netisr messaging to provide more uniform error handling and to use
lwkt_replymsg() unconditionally for both async/auto-free and sync messages
as the abstraction intended.  This also fixes a reply/free race.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Mar 6 01:58:54 2004 UTC (10 years, 6 months ago) by hsu
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +20 -31 lines
Dispatch upper-half protocol request handling.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Nov 23 00:28:01 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +3 -3 lines
Make the 'bad isr' panics a little more verbose.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Nov 20 06:05:31 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +1 -1 lines
This is a major cleanup of the LWKT message port code.  The messaging code
is getting closer to being directly useable by userland.  With these changes
message/port operations are now far better abstracted then they were before.

    * Stale fields have been removed from struct lwkt_msg.
    * lwkt_abortmsg() has been revamped to make it easier to support.
    * lwkt_waitmsg has been converted to a port function.
    * mp_*port() function fields have been renamed for better readability.
    * ms_cleanupmsg has been removed from struct lwkt_msg.
    * Union sysmsg is now struct sysmsg.
    * A copyout function has been added to struct sysmsg.
    * The system calls have been regenerated.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Fri Nov 14 00:45:20 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +6 -2 lines
MT_TAG mbufs are terrible hacks and cannot be freed.  Skip any MT_TAGs
before freeing mbufs sent to a netisr without a handler.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Nov 10 05:00:50 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +8 -2 lines
Catch attempts to queue to unregistered ISRs

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Nov 8 07:57:42 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +90 -82 lines
Network threading stage 1/3: netisrs are already software interrupts,
which means they alraedy run in their own thread.  This commit creates
multiple supporting threads for netisrs rather then just one and code
has been added to begin routing packets to particular threads based on
their content.  Eventually this will lead to us being able to isolate and
serialize PCBs in particular threads.  The tail end of the ip_input path's
protocol dispatch, the UIPC (user entry) code, and listen socket have not
been covered yet and still need to be serialized.

A new debugging sysctl, net.inet.ip.mthread_enable, has been added.  It
defaults to 1.  If you set this sysctl 0 netisr processing will revert to
the prior single-threaded behavior.

Submitted-by: Jeffrey Hsu <hsu@FreeBSD.org>
Additional-work-by: dillon

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon Sep 15 23:38:13 2003 UTC (11 years ago) by hsu
Branches: MAIN
Diff to: previous 1.1: preferred, unified
Changes since revision 1.1: +107 -24 lines
Centralize if queue handling.

Original patch against FreeBSD submitted by Jonathan Lemon.
Reviewed by Matt Dillon.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sun Jun 29 03:28:45 2003 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
threaded interrupts 1: Rewrite the ICU interrupt code, splz, and doreti code.
The APIC code hasn't been done yet.   Consolidate many interrupt thread
related functions into MI code, especially software interrupts.  All normal
interrupts and software interrupts are now threaded, and I'm almost ready
to deal with interrupt-thread-only preemption.  At the moment I run
interrupt threads in a critical section and probably will continue to do
so until I can make them MP safe.

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