cvs commit: src/sys/conf files src/sys/net if_ethersubr.c src/sys/netinet ip_input.c ip_output.c src/sys/sys mbuf.h src/sys/net/dummynet Makefile ip_dummynet.c ip_dummynet.h ip_dummynet_glue.c src/sys/net/ipfw ip_fw2.c ip_fw2.h

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Thu Nov 15 18:47:16 PST 2007


sephe       2007/11/15 18:45:45 PST

DragonFly src repository

  Modified files:
    sys/conf             files 
    sys/net              if_ethersubr.c 
    sys/netinet          ip_input.c ip_output.c 
    sys/sys              mbuf.h 
    sys/net/dummynet     Makefile ip_dummynet.c ip_dummynet.h 
    sys/net/ipfw         ip_fw2.c ip_fw2.h 
  Added files:
    sys/net/dummynet     ip_dummynet_glue.c 
  Log:
  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  Changes    Path
  1.193     +1 -0      src/sys/conf/files
  1.51      +5 -5      src/sys/net/if_ethersubr.c
  1.72      +4 -6      src/sys/netinet/ip_input.c
  1.39      +4 -4      src/sys/netinet/ip_output.c
  1.43      +1 -0      src/sys/sys/mbuf.h
  1.6       +0 -1      src/sys/net/dummynet/Makefile
  1.49      +52 -235   src/sys/net/dummynet/ip_dummynet.c
  1.17      +47 -11    src/sys/net/dummynet/ip_dummynet.h
  1.38      +127 -7    src/sys/net/ipfw/ip_fw2.c
  1.8       +13 -4     src/sys/net/ipfw/ip_fw2.h


http://www.dragonflybsd.org/cvsweb/src/sys/conf/files.diff?r1=1.192&r2=1.193&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/net/if_ethersubr.c.diff?r1=1.50&r2=1.51&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/netinet/ip_input.c.diff?r1=1.71&r2=1.72&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/netinet/ip_output.c.diff?r1=1.38&r2=1.39&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/sys/mbuf.h.diff?r1=1.42&r2=1.43&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/net/dummynet/Makefile.diff?r1=1.5&r2=1.6&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/net/dummynet/ip_dummynet.c.diff?r1=1.48&r2=1.49&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/net/dummynet/ip_dummynet.h.diff?r1=1.16&r2=1.17&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/net/ipfw/ip_fw2.c.diff?r1=1.37&r2=1.38&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/net/ipfw/ip_fw2.h.diff?r1=1.7&r2=1.8&f=u





More information about the Commits mailing list