DragonFly BSD

CVS log for src/sys/netinet/ip_input.c

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.115: download - view: text, markup, annotated - select for diffs
Tue Oct 28 07:09:26 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.114: preferred, unified
Changes since revision 1.114: +6 -13 lines
In ip_lengthcheck(), make sure that pkthdr.len is not less than "IP total
length" in IP header.  Change the related testing in ip_input() and
ipflow_fastforward() into assertion.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Tue Oct 28 03:07:28 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.113: preferred, unified
Changes since revision 1.113: +3 -4 lines
- The assertion in ip_input, should test sizeof(struct ip) instead of sizeof(ip)
- Make sure that ip_input's precondition meets in ip_localforward
- Don't allow raw ip socket to send ip packet whose header length is less than
  the minimum
- Nuke unused code and minor style changes

Reviewed-by: nth@

Revision 1.113: download - view: text, markup, annotated - select for diffs
Mon Oct 27 10:51:09 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.112: preferred, unified
Changes since revision 1.112: +4 -4 lines
Monir style and white space changes

Revision 1.112: download - view: text, markup, annotated - select for diffs
Sun Oct 26 07:11:28 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.111: preferred, unified
Changes since revision 1.111: +1 -0 lines
- Move ipflow definition from ip_flow.h to ip_flow.c; it's implementation
  detail.
- Move ipflow function declarations from in_var.h to ip_flow.h, include
  ip_flow.h in files which uses ipflow functions.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Tue Oct 21 13:51:01 2008 UTC (6 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.110: preferred, unified
Changes since revision 1.110: +26 -3 lines
Add tunable net.inet.ip.mpsafe to register IP as MPSAFE netisr.
Multicast/IPSEC still need BGL.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Wed Sep 24 14:26:39 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.109: preferred, unified
Changes since revision 1.109: +2 -1 lines
Add NETISR_FLAG_NOTMPSAFE, which could be used as the last parameter to
netisr_register(), more expressive and less error-prone than 0.

Suggested-by: hsu@

Revision 1.109: download - view: text, markup, annotated - select for diffs
Wed Sep 24 11:14:43 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.108: preferred, unified
Changes since revision 1.108: +1 -0 lines
Include necessary head file for {get,rel}_mplock() to unbreak UP kernel build

Pointed-out-by: y0netan1@

Revision 1.108: download - view: text, markup, annotated - select for diffs
Tue Sep 23 11:28:49 2008 UTC (6 years, 2 months ago) by sephe
Branches: MAIN
Diff to: previous 1.107: preferred, unified
Changes since revision 1.107: +29 -7 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.107: download - view: text, markup, annotated - select for diffs
Thu Sep 18 11:19:42 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.106: preferred, unified
Changes since revision 1.106: +22 -15 lines
If there are no pfil hooks, just remove the dummynet tag (for packets that
were trapped in pipes/queues before pfil hooks were deleted) and skip all
firwall related operation.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Sat Sep 13 12:57:07 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.105: preferred, unified
Changes since revision 1.105: +4 -64 lines
Move ipfw(4) code for ip_{input,output}() into ip_fw2.c to create in/out
pfil hooks for AF_INET pfil head.

During ipfw(4) module loading, ipfw(4) pfil hooks will be added to AF_INET
pfil head, only if fw_enable is 1.  ipfw(4) pfil hooks could be added and
deleted from AF_INET pfil head dynamicly by setting net.inet.ip.fw.enable
(1 to add, 0 to delete)

Revision 1.105: download - view: text, markup, annotated - select for diffs
Sat Sep 13 10:23:39 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.104: preferred, unified
Changes since revision 1.104: +0 -8 lines
Move ipfw(4) related bits into ip_fw2_glue.c

Revision 1.104: download - view: text, markup, annotated - select for diffs
Sat Sep 13 09:07:31 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.103: preferred, unified
Changes since revision 1.103: +1 -0 lines
pf(4) may reassemble ip fragments, so we probably should recalculate hlen

Revision 1.103: download - view: text, markup, annotated - select for diffs
Sat Sep 13 08:48:42 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.102: preferred, unified
Changes since revision 1.102: +13 -123 lines
- Move IPDIVERT related bits into netinet/ip_divert.c
- Expose ip_reass(), which is used by ip_divert_in()
- Add function ptr ip_divert_p, which will be set to ip_divert(), if IPDIVERT
  support is compiled into kernel.  ip_divert() dispatches real work to either
  ip_divert_in() or ip_divert_out() based on the third parameter
- Hide divert_packet() after above change

Revision 1.102: download - view: text, markup, annotated - select for diffs
Sat Sep 13 07:15:14 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.101: preferred, unified
Changes since revision 1.101: +8 -3 lines
Add FW_MBUF_REDISPATCH, which should be set by various firewall code,
if ip fragments get reassembled.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Sat Sep 13 05:49:08 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.100: preferred, unified
Changes since revision 1.100: +5 -1 lines
- Let caller of ip_fw_dn_io_ptr call ip_dn_queue(), so that callers have the
  chance to save additional information to dummynet tag (e.g. ip_output)
- In ip_{input,output}(), call ip_dn_queue() outside of ipfw(4) processing
  code block
- Move saving dst, ro and flags from ipfw_dummynet_io() to ip_output()
- Remove unused fields in ip_fw_args
- Update comment

Revision 1.100: download - view: text, markup, annotated - select for diffs
Sun Sep 7 11:12:15 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.99: preferred, unified
Changes since revision 1.99: +11 -13 lines
Move next_hop (tranparent forwarding) testing and extraction out of ipfw
processing code block

Revision 1.99: download - view: text, markup, annotated - select for diffs
Sun Sep 7 10:03:44 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.98: preferred, unified
Changes since revision 1.98: +139 -126 lines
Let ipfw_chk() return IP_FW_{PASS,DENY,DUMMYNET,TEE,DIVERT} and the caller
proceeds according to the return value in well strutured switch block.  The
additional information related to the return value (e.g. pipe/queue number
of IP_FW_DUMMYNET) is saved in ip_fw_args.cookie.

Idea-from: FreeBSD

Revision 1.98: download - view: text, markup, annotated - select for diffs
Sat Sep 6 14:12:50 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.97: preferred, unified
Changes since revision 1.97: +2 -1 lines
Break long line

Revision 1.97: download - view: text, markup, annotated - select for diffs
Sat Sep 6 12:04:03 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.96: preferred, unified
Changes since revision 1.96: +17 -14 lines
Move dummynet tag extraction and ipfw args setup into ipfw processing
code block

Revision 1.96: download - view: text, markup, annotated - select for diffs
Thu Aug 28 14:15:47 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.95: preferred, unified
Changes since revision 1.95: +2 -10 lines
Fix comment

Revision 1.95: download - view: text, markup, annotated - select for diffs
Thu Aug 28 14:10:03 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.94: preferred, unified
Changes since revision 1.94: +79 -87 lines
Make IPDIVERT transparent to ip reassemble code by fully utilizing the
divert information saved in the mbuf tag.

Idea-from: FreeBSD

Revision 1.94: download - view: text, markup, annotated - select for diffs
Thu Aug 28 11:55:32 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.93: preferred, unified
Changes since revision 1.93: +86 -61 lines
Move IPDIVERT processing from ip_input() normal code path to ipfw(4)
processing code block.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sat Aug 23 09:06:37 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.92: preferred, unified
Changes since revision 1.92: +1 -1 lines
White space

Revision 1.92: download - view: text, markup, annotated - select for diffs
Sat Aug 23 06:56:22 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.91: preferred, unified
Changes since revision 1.91: +56 -30 lines
Save srcroute options in a mtag associated the mbuf, mainly to eliminate two
"ugly" global variables -- ip_nhops and ip_srcrt.

Obtained-from: FreeBSD

Revision 1.91: download - view: text, markup, annotated - select for diffs
Sat Aug 23 04:50:29 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.90: preferred, unified
Changes since revision 1.90: +1 -1 lines
Staticize save_rte()

Revision 1.90: download - view: text, markup, annotated - select for diffs
Sat Aug 23 04:12:23 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.89: preferred, unified
Changes since revision 1.89: +8 -5 lines
- Test m_pkthdr.fw_flags against DUMMYNET_MBUF_TAGGED before trying to locate
  dummynet mtag.
- Clear DUMMYNET_MBUF_TAGGED from m_pkthdr.fw_flags, once dummynet mtag is
  deleted.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Fri Aug 22 13:37:22 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.88: preferred, unified
Changes since revision 1.88: +76 -76 lines
Move ip fragments reassemble related code from ip_input() to ip_reass()

Idea-from: FreeBSD

Revision 1.88: download - view: text, markup, annotated - select for diffs
Fri Aug 22 11:58:49 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.87: preferred, unified
Changes since revision 1.87: +3 -1 lines
Move ipstat.ips_reassembled updating from ip_input() into ip_reass()

Revision 1.87: download - view: text, markup, annotated - select for diffs
Fri Aug 22 11:51:40 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.86: preferred, unified
Changes since revision 1.86: +6 -7 lines
White space

Revision 1.86: download - view: text, markup, annotated - select for diffs
Fri Aug 22 10:19:27 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.85: preferred, unified
Changes since revision 1.85: +13 -20 lines
next_hop information is now saved in mtag, so the netmsg_packet embedded in
the mbuf.m_hdr is large enough to deliver all necessary information (hlen is
saved in lwkt_msg.u.ms_result) to transport layer.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Fri Aug 22 09:14:16 2008 UTC (6 years, 3 months ago) by sephe
Branches: MAIN
Diff to: previous 1.84: preferred, unified
Changes since revision 1.84: +30 -63 lines
Save 'ipfw forward' information in mtag, use m_pkthdr.fw_flags to indicate
that this mtag exists (mainly to avoid unnecessary mtag locating).  This
actually eliminates the last reference to MT_TAG mbuf; nuke it completely.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Mon Jul 28 13:45:43 2008 UTC (6 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.83: preferred, unified
Changes since revision 1.83: +1 -0 lines
Use seperate variable to indicate whether ipfw has been loaded or not, so
that following way could be used to protect various ipfw function pointers:
    ip_fw_loaded = 0;
    netmsg_service_sync();
    /* clear all ipfw function pointers */

Revision 1.83: download - view: text, markup, annotated - select for diffs
Sun Jul 27 10:06:57 2008 UTC (6 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.82: preferred, unified
Changes since revision 1.82: +1 -1 lines
Switch to ETHER_INPUT2 on ethernet input path by default:
- Nuke old ether_input_chain and ether_demux_chain
- Nuke old vlan_input
- Nuke ETHER_INPUT2 kernel option
- Adjust comment about functions on old ether input path
- Adjust NIC drivers which aware ETHER_INPUT2

vlan(4):
Clearing of ifnet.if_vlantrunks is now protected in the following way
    trunks = ifp->if_vlantrunks;
    ifp->if_vlantrunks = NULL;
    netmsg_service_sync();
    kfree(trunks);
Users of ifnet.if_vlantrunks have already been adjusted to aware of this.

bridge(4):
Clearing of ifnet.if_bridge is now protected in the following way
    ifp->if_bridge = NULL;
    netmsg_service_sync();
Users of ifnet.if_bridge have already been adjusted to aware of this.

carp(4):
Remove the LK_NOWAIT lockmgr lock flags; using LK_NOWAIT was actually a
workaround for that lockmgr lock was used in NIC's interrupt routine
(i.e. old ether_input)
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue957>

ipflow:
- Now per-cpu ipflow hash table installs its own ipflow entry instead of
  having ipflow entry duplicated onto each cpu
- Remove the serializer parameter to ipflow_fastforward()
- Comment out ipflow_fastforward() in ef(4) and ppp(4), they need to be
  changed to fit the current ipflow cpu localization model

Revision 1.82: download - view: text, markup, annotated - select for diffs
Thu Jul 3 08:22:36 2008 UTC (6 years, 5 months ago) by corecode
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0, DragonFly_Preview
Diff to: previous 1.81: preferred, unified
Changes since revision 1.81: +1 -3 lines
Make ip_forward public, so that it can be used from other places as well.

Ok'ed:  sephe@

Revision 1.81: download - view: text, markup, annotated - select for diffs
Mon Jun 9 11:24:24 2008 UTC (6 years, 6 months ago) by sephe
Branches: MAIN
Diff to: previous 1.80: preferred, unified
Changes since revision 1.80: +12 -4 lines
Parallelize in_ifaddrhashtbl

Revision 1.80: download - view: text, markup, annotated - select for diffs
Sun Jun 8 08:38:05 2008 UTC (6 years, 6 months ago) by sephe
Branches: MAIN
Diff to: previous 1.79: preferred, unified
Changes since revision 1.79: +5 -3 lines
Parallelize in_ifaddrhead operation

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sun Apr 20 13:44:25 2008 UTC (6 years, 8 months ago) by swildner
Branches: MAIN
Diff to: previous 1.78: preferred, unified
Changes since revision 1.78: +1 -1 lines
Another round of typo fixes (mostly in messages).

Revision 1.78: download - view: text, markup, annotated - select for diffs
Thu Apr 3 13:43:29 2008 UTC (6 years, 8 months ago) by sephe
Branches: MAIN
Diff to: previous 1.77: preferred, unified
Changes since revision 1.77: +1 -1 lines
Parallelize ip_flow:
- Create per-CPU ipflow hash table.  During initial ipflow installation, route
  entry to the destination is allocated on each CPU and cached in the ipflow,
  so each CPU will only access the route entry owned by itself.
- Timeout processing on per-CPU ipflow hash table is initialized by broadcasting
  IPI to each CPU.  In IPI, a per-CPU netmsg is used to inform CPU local netisr
  to do the real timout processing.
- Add sysctl node to show how many ipflow entries are used on the each CPU.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Fri Mar 7 11:34:20 2008 UTC (6 years, 9 months ago) by sephe
Branches: MAIN
Diff to: previous 1.76: preferred, unified
Changes since revision 1.76: +6 -2 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.76: download - view: text, markup, annotated - select for diffs
Fri Dec 28 13:27:45 2007 UTC (6 years, 11 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12
Diff to: previous 1.75: preferred, unified
Changes since revision 1.75: +1 -1 lines
Use M_ASSERTPKTHDR

Revision 1.75: download - view: text, markup, annotated - select for diffs
Wed Dec 19 11:00:22 2007 UTC (7 years ago) by sephe
Branches: MAIN
Diff to: previous 1.74: preferred, unified
Changes since revision 1.74: +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.74: download - view: text, markup, annotated - select for diffs
Thu Nov 22 19:57:14 2007 UTC (7 years ago) by dillon
Branches: MAIN
Diff to: previous 1.73: preferred, unified
Changes since revision 1.73: +1 -1 lines
Replace the very predictable 'random' IP sequence number generator with
something far less predictable.  Use DragonFly's built-in PRNG and add a
shuffle algorithm.  We eat 128KB of ram for the shuffle array but I've
pretty much had it with roll-your-own PRNGs.  At least this way any PRNG
issues can be corrected in one place -- our system PRNG.

Turn net.inet.ip.random_id on by default.  Eat the minor loss in performance.
On the bright side, our PRNG is very fast, so this should not represent
a burden.

References: Analysis of BSD ip randomizer algorithm by "Amit Klein"
	    <amit.klein@trusteer.com> showing serious vulnerabilities in
	    the algorithm.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Fri Nov 16 05:07:36 2007 UTC (7 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.72: preferred, unified
Changes since revision 1.72: +0 -11 lines
Nuke net/intrq.[ch] and ipintrq related bits; they were gone almost three
years ago.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Fri Nov 16 02:45:45 2007 UTC (7 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.71: preferred, unified
Changes since revision 1.71: +4 -6 lines
CPU localize dummynet(4) step 1/2

       CPU ip_dn_cpu                             CPU n1
+--------------------------+            +---------------------+
|          netisr          |            |                     |
|            |             |            |                     |
|            +<---------------dn_descX----[ip_fw_dn_io_ptr()] |
|            |             |            |                     |
| [ip_dn_io_ptr(dn_descX)] |            |                     |
|            |             |            |                     |
|            |             |            |                     |
|            |             |            |                     |
| [transmit_event() begin  |            |                     |
|            +----------------dn_descY------>[ip_output()]    |
|            :             |            |                     |
|            :             |            |                     |
|            :             |            +---------------------+
|            :             |
|            :             |
|            :             |                     CPU n2
|            :             |            +---------------------+
|            :             |            |                     |
|            +----------------dn_descZ------>[ip_input()]     |
|            :             |            |                     |
|  transmit_event() end]   |            +---------------------+
|            |             |
+--------------------------+

NOTE: transmit_event() is triggered by dummynet systimer on CPU ip_dn_cpu


- Add flow id field, which is packet filter independent, in dummynet
  descriptor, so that we can record the flow id realted information on the
  originator's stack.  In this way, dummynet descriptor and its associated
  mbuf could be dispatched to different thread for further processing.
- Add packet filter private data and private data unreference function
  pointer in dummynet descriptor.
- All of the dummynet descriptor is allocated and filled by packet filter
  (only ipfw(4) currently), so things like route entry reference is updated
  on the CPU to which it belongs.
- All packets are dispatched to netisr on CPU ip_dn_cpu to be queued on the
  target flow queue.  Netisr on CPU ip_dn_cpu is also where various dummynet
  events got processed.
- DUMMYNET_LOADED is not checked before dispatching a packet; it is checked
  in netisr before the packet is handed to dummynet.  This paves the way for
  step 2/2.
- ip_{output,input}/ether_{demux,output_frame} is no longer called directly
  in dummynet, they are called after packet dispatched back to the originator
  CPU, so that ip_input() will be called on the same CPU (as determined by
  ip_mport()) and things like route entry reference will be updated on the
  CPU to which it belongs.
- If the packet is to be dispatched back to ip_output(), the recorded route
  entry is checked to make sure that it is still up.
- Dummynet discriptor and its associated mbuf is freed on their originator CPU.
- Reference count the ipfw(4) rule if it is going to be associated with a
  dummynet descriptor, so we would not have a dangling rule pointer if the
  rule was deleted when the dummynet descriptor was in transit state.
  Suggested-by: dillon@
- If ipfw(4) is compiled and loaded as module, reference count the ipfw(4)
  module usage, if a rule is associated with a dummynet descriptor.
- Add net/dummynet/ip_dummynet_glue.c, which contains various netisr dispatch
  function.  This file will be compiled into kernel if 'options INET' is set,
  so that we will not have a dangling function pointer in transitting dummynet
  descriptor.
- Add DUMMYNET_MBUF_TAGGED mbuf fw_flag, which may be used later.
- Nuke dummynet's dependency on ipfw(4).

Revision 1.71: download - view: text, markup, annotated - select for diffs
Thu Oct 25 13:13:18 2007 UTC (7 years, 1 month ago) by sephe
Branches: MAIN
Diff to: previous 1.70: preferred, unified
Changes since revision 1.70: +9 -5 lines
- Switch dummynet(4) from mbuf based tagging to mtag.
- Fix comment concerning mtag in sys/mbuf.h

Reviewed-by: dillon@

Revision 1.67.2.2: download - view: text, markup, annotated - select for diffs
Sat Aug 25 18:42:58 2007 UTC (7 years, 3 months ago) by swildner
Branches: DragonFly_RELEASE_1_10
Diff to: previous 1.67.2.1: preferred, unified; next MAIN 1.68: preferred, unified
Changes since revision 1.67.2.1: +3 -1 lines
MFC two fixes that were obviously forgotten so far:

etc/Makefile           - rev 1.3
sys/netinet/ip_input.c - rev 1.69

Reported-by: Y.K. in the comments section of the digest

Revision 1.70: download - view: text, markup, annotated - select for diffs
Tue Aug 14 13:30:35 2007 UTC (7 years, 4 months ago) by sephe
Branches: MAIN
Diff to: previous 1.69: preferred, unified
Changes since revision 1.69: +10 -0 lines
Add a new csum flag to tell IP defragmenter that csum_data does _not_
contain a valid IP fragment payload checksum.  This flag is only intented
to be used by IP defragmenter.

Currently only bce(4), bge(4) and ti(4) provide valid IP fragment payload
checksum.  Turn on the new csum flag for the rest of the drivers, which
support hardware TCP/UDP checksum offload but hard-wire csum_data to 0xffff,
to avoid bypassing verification of defragmented payload's checksum.

Discussed-with: dillon@, hsu@
Approved-by: dillon@

Revision 1.69: download - view: text, markup, annotated - select for diffs
Sat Aug 11 18:57:34 2007 UTC (7 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.68: preferred, unified
Changes since revision 1.68: +3 -1 lines
Add another fix to the 1's complement checksum.  A second carry does not
occur when the individual packet csum's are set to 0xffff, which is normally
the case.  But if we ever use csum_data to accumulate partial fragment
checksums then a second carry can occur which must be handled.  Fix it now.

Revision 1.67.2.1: download - view: text, markup, annotated - select for diffs
Sat Aug 11 17:56:55 2007 UTC (7 years, 4 months ago) by dillon
Branches: DragonFly_RELEASE_1_10
CVS tags: DragonFly_RELEASE_1_10_Slip
Diff to: previous 1.67: preferred, unified
Changes since revision 1.67: +9 -0 lines
MFC 1.68 - correct csum_data field when reassembling IP fragments.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Fri Aug 10 18:23:07 2007 UTC (7 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.67: preferred, unified
Changes since revision 1.67: +9 -0 lines
The 1's complement checksum in m->m_pkthdr.csum_data was not being properly
calculated.  With 1's complement you have to take the carry past 16 bits
and fold it back into the checksum.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Wed May 23 08:57:09 2007 UTC (7 years, 7 months ago) by dillon
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_10
Diff to: previous 1.66: preferred, unified
Changes since revision 1.66: +13 -16 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.66: download - view: text, markup, annotated - select for diffs
Wed Apr 4 06:13:26 2007 UTC (7 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.65: preferred, unified
Changes since revision 1.65: +6 -0 lines
Add IP_MINTTL socket option - used to set the minimum acceptable TTL a
packet must have when received on a socket.  All packets with a lower TTL
are silently dropped.  Works on already connected/connecting and listening
sockets for RAW/UDP/TCP.

Add IP_RECVTTL socket option support - When set, userland receives the
incoming packet's TTL as ancillary data with recvmsg(2) call.

Allows the implementation of security mechanisms described in RFC3682 (GTSM).

Obtained-from: FreeBSD.
Submitted-by: Hasso Tepper <hasso@estpak.ee>

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

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

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

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sat May 20 06:32:40 2006 UTC (8 years, 7 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.61: preferred, unified
Changes since revision 1.61: +1 -1 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.61: download - view: text, markup, annotated - select for diffs
Tue Jan 31 19:05:40 2006 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.60: preferred, unified
Changes since revision 1.60: +23 -19 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.60: download - view: text, markup, annotated - select for diffs
Fri Oct 28 15:56:47 2005 UTC (9 years, 1 month ago) by liamfoy
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_4_Slip, DragonFly_RELEASE_1_4
Diff to: previous 1.59: preferred, unified
Changes since revision 1.59: +13 -31 lines
- Dont pass a complete interface struct to icmp_error, just pass the mtu.

Obtained from: OpenBSD Camp
Ok'ed: dillon

Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Sep 22 06:45:01 2005 UTC (9 years, 2 months ago) by demizu
Branches: MAIN
Diff to: previous 1.58: preferred, unified
Changes since revision 1.58: +2 -0 lines
Suppress kernel message "mfree: m->m_nextpkt != NULL",
which is printed by m_free() in kern/uipc_mbuf.c.
Reported-by: Dave Hayes

Revision 1.58: download - view: text, markup, annotated - select for diffs
Wed Aug 31 22:21:23 2005 UTC (9 years, 3 months ago) by hsu
Branches: MAIN
Diff to: previous 1.57: preferred, unified
Changes since revision 1.57: +5 -5 lines
Fix indentation with previous commit.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Wed Aug 31 22:18:46 2005 UTC (9 years, 3 months ago) by hsu
Branches: MAIN
Diff to: previous 1.56: preferred, unified
Changes since revision 1.56: +8 -7 lines
Check the IP length first to avoid a memory leak later.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Mon Aug 15 16:46:21 2005 UTC (9 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.55: preferred, unified
Changes since revision 1.55: +4 -3 lines
Convert RANDOM_IP_ID into a sysctl.

Submitted-by: Gordon Bergling <gbergling@0xfce3.net>

Revision 1.55: download - view: text, markup, annotated - select for diffs
Fri Jun 17 19:12:20 2005 UTC (9 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.54: preferred, unified
Changes since revision 1.54: +2 -2 lines
Abstract out the location of an m_tag's data by adding a m_tag_data() inline.
Replace all instances of 'mtag + 1' with the new inline.

Fix numerous bugs, mainly in ipfw/ipfw2, where the m_tag data was being stored
in the wrong place and corrupting the m_tag, resulting in a panic.  This
primarily occured with the use of divert rules.

Reported-by: Ben Woolley <tautolog@gmail.com>

Revision 1.54: download - view: text, markup, annotated - select for diffs
Wed Jun 8 23:45:00 2005 UTC (9 years, 6 months ago) by hsu
Branches: MAIN
Diff to: previous 1.53: preferred, unified
Changes since revision 1.53: +1 -1 lines
Get an mbuf packet header to begin with instead of getting an mbuf and then
immediately changing it into an mbuf packet header.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Fri Jun 3 23:23:03 2005 UTC (9 years, 6 months ago) by joerg
Branches: MAIN
Diff to: previous 1.52: preferred, unified
Changes since revision 1.52: +1 -2 lines
Add a new macro IF_LLSOCKADDR which maps a ifnet pointer to the
associated link layer sockaddr. Use it to implement IF_LLADDR.
Replace most references of ifnet_addrs with one of those macros.

This makes the sometimes explicitly encoded assumption of each
interface having a link-layer address implicit and is the
preparation for removing ifnet_addrs.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Thu Jun 2 23:52:42 2005 UTC (9 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.51: preferred, unified
Changes since revision 1.51: +8 -8 lines
Remove spl*() calls from netinet, replacing them with critical sections.
A slight rearrangement of COMMON_START() in tcp_usrreq.c was necessary to
ensure that the inp is loaded after  entering the critical section.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Mon Apr 18 23:43:04 2005 UTC (9 years, 8 months ago) by hsu
Branches: MAIN
CVS tags: DragonFly_Stable
Diff to: previous 1.50: preferred, unified
Changes since revision 1.50: +8 -9 lines
Defer assigning to the forwarding route variable until the forwarding
route has been determined.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Mon Apr 18 22:57:52 2005 UTC (9 years, 8 months ago) by hsu
Branches: MAIN
Diff to: previous 1.49: preferred, unified
Changes since revision 1.49: +27 -23 lines
Minor cosmetic cleanups.  Use the canonical name "ro" for a variable
of type struct route.  Clean up ip_forward().

Revision 1.49: download - view: text, markup, annotated - select for diffs
Mon Apr 18 14:26:57 2005 UTC (9 years, 8 months ago) by joerg
Branches: MAIN
Diff to: previous 1.48: preferred, unified
Changes since revision 1.48: +22 -17 lines
Switch IP divert from mbuf based tagging to mbuf tags.
This patch is meant to keep the old semantic, the divert
handling can be pushed down in most places later.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Mon Apr 11 10:24:45 2005 UTC (9 years, 8 months ago) by hmp
Branches: MAIN
Diff to: previous 1.47: preferred, unified
Changes since revision 1.47: +5 -8 lines
Mechanical cleanup of IP per-cpu statistics code, better naming etc.

Correct a stale comment regarding initialisation of the counters.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Fri Mar 4 03:48:25 2005 UTC (9 years, 9 months ago) by hsu
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.46: preferred, unified
Changes since revision 1.46: +1 -1 lines
Cosmetic changes only.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Fri Feb 11 22:25:57 2005 UTC (9 years, 10 months ago) by joerg
Branches: MAIN
Diff to: previous 1.45: preferred, unified
Changes since revision 1.45: +6 -0 lines
Import ALTQ support from KAME. This is based on the FreeBSD 4 snapshot.
This includes neither the ALTQ3 compat code nor the !DragonFly defines.
The macros have been replaced with inline functions in net/ifq_var.h.

This also renames pkthdr.pf_flags as it is intended as general flag bit.
Currently supported are ppp(4), sppp(4), tun(4) and wi(4), more drivers
are coming later.

Reviewed-by: corecode, dillon, hsu
Comments-from: hmp

Revision 1.45: download - view: text, markup, annotated - select for diffs
Wed Jan 26 23:09:57 2005 UTC (9 years, 10 months ago) by hsu
Branches: MAIN
Diff to: previous 1.44: preferred, unified
Changes since revision 1.44: +1 -1 lines
Code cleanup.  Refactor some functions.  Push some globals into local scope.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Tue Jan 25 21:24:49 2005 UTC (9 years, 10 months ago) by joerg
Branches: MAIN
Diff to: previous 1.43: preferred, unified
Changes since revision 1.43: +1 -1 lines
Fix a type in rev. 1.16

Revision 1.43: download - view: text, markup, annotated - select for diffs
Wed Dec 29 03:26:42 2004 UTC (9 years, 11 months ago) by hsu
Branches: MAIN
Diff to: previous 1.42: preferred, unified
Changes since revision 1.42: +1 -1 lines
Forced commit to say the previous commit wasn't really a buffer overflow
after all, but the code is more uniform this way, so leave it like this,
except for ipsec.c where we use the standard libkern inet_ntoa() instead of
defining a private copy.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Dec 29 01:19:53 2004 UTC (9 years, 11 months ago) by hsu
Branches: MAIN
Diff to: previous 1.41: preferred, unified
Changes since revision 1.41: +2 -1 lines
Fix buffer overflow bug involving inet_ntoa().

Revision 1.41: download - view: text, markup, annotated - select for diffs
Tue Dec 28 08:09:59 2004 UTC (9 years, 11 months ago) by hsu
Branches: MAIN
Diff to: previous 1.40: preferred, unified
Changes since revision 1.40: +19 -22 lines
Clean up the networking code before I parallelize the routing code.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Tue Dec 21 02:54:15 2004 UTC (10 years ago) by hsu
Branches: MAIN
Diff to: previous 1.39: preferred, unified
Changes since revision 1.39: +16 -16 lines
Clean up the routing and networking code before I parallelize routing.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Dec 20 17:15:40 2004 UTC (10 years ago) by dillon
Branches: MAIN
Diff to: previous 1.38: preferred, unified
Changes since revision 1.38: +3 -3 lines
Fix format %lx->%x for ntohl conversions in diagnostic warning printfs.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Mon Dec 20 01:26:44 2004 UTC (10 years ago) by dillon
Branches: MAIN
Diff to: previous 1.37: preferred, unified
Changes since revision 1.37: +2 -0 lines
There seems to be a race during shutdown where ifa->ifa_addr can become
NULL during or just before the processing of an IP packet.  We probably need
some sort of synchronization between interface updates and the IP stack,
but for now just check for the case.

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

Revision 1.37: download - view: text, markup, annotated - select for diffs
Tue Nov 30 19:21:26 2004 UTC (10 years ago) by joerg
Branches: MAIN
Diff to: previous 1.36: preferred, unified
Changes since revision 1.36: +5 -6 lines
Remove struct ipprotosw. It's identical to protosw, so use the generic
version directly.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sat Oct 16 23:20:00 2004 UTC (10 years, 2 months ago) by hsu
Branches: MAIN
Diff to: previous 1.35: preferred, unified
Changes since revision 1.35: +1 -0 lines
From KAME freebsd4/sys/netinet/ip_input.c rev 1.42:

  Set m->m_pkthdr.len for the saved mbuf (mcopy) to make
  ipsec4_getpolicybyaddr() successful.

Same as FreeBSD rev 1.273 fix to FreeBSD PR kern/42727.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Fri Oct 15 22:59:10 2004 UTC (10 years, 2 months ago) by hsu
Branches: MAIN
Diff to: previous 1.34: preferred, unified
Changes since revision 1.34: +2 -2 lines
Update includes now that the Fast IPSec code has moved to netproto/ipsec.

Submitted by:  Pawel Biernacki <kaktus@dragonflybsd.pl>

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun Jul 18 16:26:43 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004
Diff to: previous 1.33: preferred, unified
Changes since revision 1.33: +8 -8 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.33: download - view: text, markup, annotated - select for diffs
Thu Jul 8 22:07:35 2004 UTC (10 years, 5 months ago) by hsu
Branches: MAIN
CVS tags: DragonFly_1_0_REL, DragonFly_1_0A_REL
Diff to: previous 1.32: preferred, unified
Changes since revision 1.32: +50 -1 lines
Add the standard DragonFly copyright notice to go along with mine.

Approved by:	Matt

Revision 1.32: download - view: text, markup, annotated - select for diffs
Fri Jul 2 04:41:01 2004 UTC (10 years, 5 months ago) by hsu
Branches: MAIN
Diff to: previous 1.31: preferred, unified
Changes since revision 1.31: +1 -0 lines
Update some of my copyright notices before we officially publish
DragonFlyBSD in Release 1.0.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Jun 24 08:15:17 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_1_0_RC1
Diff to: previous 1.30: preferred, unified
Changes since revision 1.30: +2 -12 lines
Get rid of the PFIL_HOOKS option, integrate pfil in the system permanently.
(previously the packet filters couldn't even be kldload'd without PFIL_HOOKS).

Revision 1.30: download - view: text, markup, annotated - select for diffs
Fri Jun 4 03:57:41 2004 UTC (10 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.29: preferred, unified
Changes since revision 1.29: +18 -9 lines
Use MPIPE instead of (the really aweful improper use of) mbuf_alloc() for
struct ipq.  This also gets rid of a nasty dtoc().

Revision 1.29: download - view: text, markup, annotated - select for diffs
Fri Jun 4 01:46:49 2004 UTC (10 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.28: preferred, unified
Changes since revision 1.28: +4 -4 lines
ANSIfication.  No functional changes.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Thu Jun 3 18:30:03 2004 UTC (10 years, 6 months ago) by joerg
Branches: MAIN
Diff to: previous 1.27: preferred, unified
Changes since revision 1.27: +11 -1 lines
Make pr_input use variadic arguments for anything but the first mbuf.

Add a warning for NSIP, it is likely to be broken.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Wed Jun 2 14:43:01 2004 UTC (10 years, 6 months ago) by eirikn
Branches: MAIN
Diff to: previous 1.26: preferred, unified
Changes since revision 1.26: +5 -5 lines
Change mbug allocation flags from M_ to MB_ to avoid confusion with malloc
flags.

Requested by: Jeffrey Hsu

Revision 1.26: download - view: text, markup, annotated - select for diffs
Tue Jun 1 20:49:06 2004 UTC (10 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +11 -7 lines
Add a pfil_has_hooks() inline to shortcut calls to pfil_run_hooks(),
allowing us to include PFIL_HOOKS without introducing any performance impact
when no hooks are being used.  This is in prep for making PFIL_HOOKS
permanent.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Tue May 4 11:53:26 2004 UTC (10 years, 7 months ago) by hmp
Branches: MAIN
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +2 -2 lines
Clean warnings under DIAGNOSTIC.

Noticed-by: 	LINT

Revision 1.24: download - view: text, markup, annotated - select for diffs
Mon May 3 15:18:25 2004 UTC (10 years, 7 months ago) by hmp
Branches: MAIN
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +43 -2 lines
Make IP statistics counters per-CPU so they can be updated safely.

	* For SMP, we index into the array with the current CPU's
	  as ipstats_ary[gd->gd_cpuid], and for UP we just return
	  struct at ipstats_ary[0] (CPU-0).

	* Rename the structure from ipstat to ip_stats.

	* Wrap function definition of CPU counter aggregation in a
	  macro called CPU_STATS_FUNC() to avoid duplication.

	* Retain support for resetting the counters using netstat(1).

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sat Apr 24 07:05:56 2004 UTC (10 years, 7 months ago) by hsu
Branches: MAIN
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +14 -14 lines
Cosmetic changes.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sat Apr 24 01:40:34 2004 UTC (10 years, 7 months ago) by hsu
Branches: MAIN
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +2 -0 lines
Drop packet if the length checks fail in ip_demux().

Revision 1.21: download - view: text, markup, annotated - select for diffs
Thu Apr 22 04:26:28 2004 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +1 -1 lines
Use M_INTWAIT instead of M_NOWAIT in the ip messaging redispatch case to
avoid random drops.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Wed Apr 21 18:13:56 2004 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +5 -4 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.19: download - view: text, markup, annotated - select for diffs
Tue Apr 20 01:52:28 2004 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +9 -9 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.18: download - view: text, markup, annotated - select for diffs
Tue Apr 13 00:14:01 2004 UTC (10 years, 8 months ago) by hsu
Branches: MAIN
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +20 -13 lines
Create another entry point into ip_input() so MT_TAGs will work.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Fri Apr 9 22:34:10 2004 UTC (10 years, 8 months ago) by hsu
Branches: MAIN
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +7 -5 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.16: download - view: text, markup, annotated - select for diffs
Wed Apr 7 09:36:07 2004 UTC (10 years, 8 months ago) by hsu
Branches: MAIN
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +215 -239 lines
Cosmetic changes.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:18:30 2004 UTC (10 years, 8 months ago) by hsu
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +77 -16 lines
Dispatch reassembled fragment.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Apr 1 23:04:50 2004 UTC (10 years, 8 months ago) by hsu
Branches: MAIN
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +3 -11 lines
Consolidate length checks in ip_demux().

Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon Mar 22 06:38:17 2004 UTC (10 years, 9 months ago) by hsu
Branches: MAIN
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +2 -8 lines
Consolidate length checks in ip_demux().

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Mar 6 07:30:43 2004 UTC (10 years, 9 months ago) by hsu
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +9 -15 lines
Remove unused second argument to ip_stripoptions().

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

Revision 1.10: download - view: text, markup, annotated - select for diffs
Sat Feb 14 21:12:39 2004 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +1 -1 lines
Move <machine/in_cksum.h> to <sys/in_cksum.h>.  This file is now platform
independant.  If we want to add extreme machine specialization later on
then sys/in_cksum.h will #include machine/in_cksum.h.

Move i386/i386/in_cksum.c to netinet/in_cksum.c.  Note that netinet/in_cksum.c
already existed but was not used by the build system at all.  The move
overwrites it.  The new in_cksum.c is a portable, complete rewrite which
references core assembly (procedure call) to do 32-bit-aligned work.  See
also i386/i386/in_cksum2.s.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Tue Dec 2 08:00:22 2003 UTC (11 years ago) by asmodai
Branches: MAIN
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +36 -12 lines
Add PFIL_HOOKS functionality.  This allows us to plug in many firewalling
architectures by using/having generic hooks in the networking code.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Nov 8 07:57:51 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +7 -3 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.7: download - view: text, markup, annotated - select for diffs
Mon Sep 15 23:38:14 2003 UTC (11 years, 3 months ago) by hsu
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +2 -21 lines
Centralize if queue handling.

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

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Aug 23 11:18:00 2003 UTC (11 years, 4 months ago) by rob
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +1 -1 lines
if ipv6 doesnt need oldstyle prototypes maybe its time we took them out
of ipv4's code

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Aug 7 21:54:32 2003 UTC (11 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +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.4: download - view: text, markup, annotated - select for diffs
Thu Aug 7 21:17:33 2003 UTC (11 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +2 -2 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.3: download - view: text, markup, annotated - select for diffs
Sat Jul 26 21:00:04 2003 UTC (11 years, 4 months ago) by rob
Branches: MAIN
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +17 -17 lines
Register keyword removal

Approved by: Matt Dillon

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 04:28:51 2003 UTC (11 years, 6 months ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
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:34 2003 UTC (11 years, 6 months ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
import from FreeBSD RELENG_4 1.130.2.52

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