1. 28 4月, 2011 10 次提交
    • E
      net: filter: Just In Time compiler for x86-64 · 0a14842f
      Eric Dumazet 提交于
      In order to speedup packet filtering, here is an implementation of a
      JIT compiler for x86_64
      
      It is disabled by default, and must be enabled by the admin.
      
      echo 1 >/proc/sys/net/core/bpf_jit_enable
      
      It uses module_alloc() and module_free() to get memory in the 2GB text
      kernel range since we call helpers functions from the generated code.
      
      EAX : BPF A accumulator
      EBX : BPF X accumulator
      RDI : pointer to skb   (first argument given to JIT function)
      RBP : frame pointer (even if CONFIG_FRAME_POINTER=n)
      r9d : skb->len - skb->data_len (headlen)
      r8  : skb->data
      
      To get a trace of generated code, use :
      
      echo 2 >/proc/sys/net/core/bpf_jit_enable
      
      Example of generated code :
      
      # tcpdump -p -n -s 0 -i eth1 host 192.168.20.0/24
      
      flen=18 proglen=147 pass=3 image=ffffffffa00b5000
      JIT code: ffffffffa00b5000: 55 48 89 e5 48 83 ec 60 48 89 5d f8 44 8b 4f 60
      JIT code: ffffffffa00b5010: 44 2b 4f 64 4c 8b 87 b8 00 00 00 be 0c 00 00 00
      JIT code: ffffffffa00b5020: e8 24 7b f7 e0 3d 00 08 00 00 75 28 be 1a 00 00
      JIT code: ffffffffa00b5030: 00 e8 fe 7a f7 e0 24 00 3d 00 14 a8 c0 74 49 be
      JIT code: ffffffffa00b5040: 1e 00 00 00 e8 eb 7a f7 e0 24 00 3d 00 14 a8 c0
      JIT code: ffffffffa00b5050: 74 36 eb 3b 3d 06 08 00 00 74 07 3d 35 80 00 00
      JIT code: ffffffffa00b5060: 75 2d be 1c 00 00 00 e8 c8 7a f7 e0 24 00 3d 00
      JIT code: ffffffffa00b5070: 14 a8 c0 74 13 be 26 00 00 00 e8 b5 7a f7 e0 24
      JIT code: ffffffffa00b5080: 00 3d 00 14 a8 c0 75 07 b8 ff ff 00 00 eb 02 31
      JIT code: ffffffffa00b5090: c0 c9 c3
      
      BPF program is 144 bytes long, so native program is almost same size ;)
      
      (000) ldh      [12]
      (001) jeq      #0x800           jt 2    jf 8
      (002) ld       [26]
      (003) and      #0xffffff00
      (004) jeq      #0xc0a81400      jt 16   jf 5
      (005) ld       [30]
      (006) and      #0xffffff00
      (007) jeq      #0xc0a81400      jt 16   jf 17
      (008) jeq      #0x806           jt 10   jf 9
      (009) jeq      #0x8035          jt 10   jf 17
      (010) ld       [28]
      (011) and      #0xffffff00
      (012) jeq      #0xc0a81400      jt 16   jf 13
      (013) ld       [38]
      (014) and      #0xffffff00
      (015) jeq      #0xc0a81400      jt 16   jf 17
      (016) ret      #65535
      (017) ret      #0
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Ben Hutchings <bhutchings@solarflare.com>
      Cc: Hagen Paul Pfeifer <hagen@jauu.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0a14842f
    • D
      ipv4: Kill RTO_CONN. · b678027c
      David S. Miller 提交于
      It's not used by anything in the kernel, and defined in net/route.h so
      never exported to userspace.
      
      Therefore we can safely remove it.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b678027c
    • D
      ipv4: Remove erroneous check in igmpv3_newpack() and igmp_send_report(). · 2e97e980
      David S. Miller 提交于
      Output route resolution never returns a route with rt_src set to zero
      (which is INADDR_ANY).
      
      Even if the flow key for the output route lookup specifies INADDR_ANY
      for the source address, the output route resolution chooses a real
      source address to use in the final route.
      
      This test has existed forever in igmp_send_report() and David Stevens
      simply copied over the erroneous test when implementing support for
      IGMPv3.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Reviewed-by: NEric Dumazet <eric.dumazet@gmail.com>
      2e97e980
    • D
      ipv4: Sanitize and simplify ip_route_{connect,newports}() · 2d7192d6
      David S. Miller 提交于
      These functions are used together as a unit for route resolution
      during connect().  They address the chicken-and-egg problem that
      exists when ports need to be allocated during connect() processing,
      yet such port allocations require addressing information from the
      routing code.
      
      It's currently more heavy handed than it needs to be, and in
      particular we allocate and initialize a flow object twice.
      
      Let the callers provide the on-stack flow object.  That way we only
      need to initialize it once in the ip_route_connect() call.
      
      Later, if ip_route_newports() needs to do anything, it re-uses that
      flow object as-is except for the ports which it updates before the
      route re-lookup.
      
      Also, describe why this set of facilities are needed and how it works
      in a big comment.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Reviewed-by: NEric Dumazet <eric.dumazet@gmail.com>
      2d7192d6
    • F
      r8169: fix merge conflict fix. · 15ecd039
      Francois Romieu 提交于
      - use adequate MAC_VER id
        (see 01dc7fec)
      - remove duplicate rtl_firmware_info record
      - remove duplicate functions
      Signed-off-by: NFrancois Romieu <romieu@fr.zoreil.com>
      Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      15ecd039
    • V
      sctp: clean up route lookup calls · da0420be
      Vlad Yasevich 提交于
      Change the call to take the transport parameter and set the
      cached 'dst' appropriately inside the get_dst() function calls.
      
      This will allow us in the future  to clean up source address
      storage as well.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NWei Yongjun <yjwei@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da0420be
    • V
      sctp: remove useless arguments from get_saddr() call · af138470
      Vlad Yasevich 提交于
      There is no point in passing a destination address to
      a get_saddr() call.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NWei Yongjun <yjwei@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af138470
    • V
      sctp: make sctp over IPv6 work with IPsec · 9c6a02f4
      Vlad Yasevich 提交于
      SCTP never called xfrm_output after it's v6 route lookups so
      that never really worked with ipsec.  Additioanlly, we never
      passed port nubmers and protocol in the flowi, so any port
      based policies were never applied as well.  Now that we can
      fixed ipv6 routing lookup code, using ip6_dst_lookup_flow()
      and pass port numbers.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NWei Yongjun <yjwei@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c6a02f4
    • V
      sctp: cache the ipv6 source after route lookup · 9914ae3c
      Vlad Yasevich 提交于
      The ipv6 routing lookup does give us a source address,
      but instead of filling it into the dst, it's stored in
      the flowi.  We can use that instead of going through the
      entire source address selection again.
      Also the useless ->dst_saddr member of sctp_pf is removed.
      And sctp_v6_dst_saddr() is removed, instead by introduce
      sctp_v6_to_addr(), which can be reused to cleanup some dup
      code.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NWei Yongjun <yjwei@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9914ae3c
    • W
      sctp: fix sctp to work with ipv6 source address routing · 62503411
      Weixing Shi 提交于
      In the below test case, using the source address routing,
      sctp can not work.
      Node-A
      1)ifconfig eth0 inet6 add 2001:1::1/64
      2)ip -6 rule add from 2001:1::1 table 100 pref 100
      3)ip -6 route add 2001:2::1 dev eth0 table 100
      4)sctp_darn -H 2001:1::1 -P 250 -l &
      Node-B
      1)ifconfig eth0 inet6 add 2001:2::1/64
      2)ip -6 rule add from 2001:2::1 table 100 pref 100
      3)ip -6 route add 2001:1::1 dev eth0 table 100
      4)sctp_darn -H 2001:2::1 -P 250 -h 2001:1::1 -p 250 -s
      
      root cause:
      Node-A and Node-B use the source address routing, and
      at begining, source address will be NULL,sctp will
      search the  routing table by the destination address,
      because using the source address routing table, and
      the result dst_entry will be NULL.
      
      solution:
      walk through the bind address list to get the source
      address and then lookup the routing table again to get
      the correct dst_entry.
      Signed-off-by: NWeixing Shi <Weixing.Shi@windriver.com>
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NWei Yongjun <yjwei@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62503411
  2. 27 4月, 2011 13 次提交
  3. 26 4月, 2011 13 次提交
  4. 25 4月, 2011 3 次提交
  5. 24 4月, 2011 1 次提交