1. 22 3月, 2017 3 次提交
    • D
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 406910a8
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      40GbE Intel Wired LAN Driver Updates 2017-03-20
      
      This series contains updates to i40e and i40evf only.
      
      Philippe Reynes updates i40e and i40evf to use the new ethtool API for
      {get|set}_link_ksettings.
      
      Jake provides the remaining patches in the series, starting with a fix
      for i40e where the firmware expected the port numbers for the offloaded
      UDP tunnels in Little Endian format and we were sending them in Big Endian
      format which put the wrong port number to be put in the UDP tunnel list.
      Changed the driver to use __be32 values instead of arrays for
      (src|dst)_ip.  Refactored the exit flow of i40e_add_fdir_ethtool() which
      removes the dependency on having a non-zero return value.  Fixed a memory
      leak by running kfree() and returning immediately when we fail to add
      flow director filter.  Fixed a potential issue where could update the
      filter count without actually succeeding in adding a filter, by moving
      the ATR exit check to after we have sent the TCP/IPv4 filter to the ring
      successfully.  Ensures that the fd_tcp_rule count is reset to 0, before
      we reprogram the filters so that we do not end up with a stale count
      which does not correctly reflect the number of programmed filters.  Added
      a check whether we have TCP/IPv4 filters before re-enabling ATR after
      flushing and replaying FDIR filters.  Added counters for each filter
      type in preparation for adding code to properly check the mask value.
      Fixed potential issues by explicitly checking the flow type at the
      start of i40e_add_fdir_ethtool().  To avoid possible memory leaks,
      we now unconditionally delete the old filter, even if it is identical to
      the new filter and ensures will always update the filters as expected.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      406910a8
    • D
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next · 41e95736
      David S. Miller 提交于
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter/IPVS updates for net-next
      
      The following patchset contains Netfilter/IPVS updates for your
      net-next tree. A couple of new features for nf_tables, and unsorted
      cleanups and incremental updates for the Netfilter tree. More
      specifically, they are:
      
      1) Allow to check for TCP option presence via nft_exthdr, patch
         from Phil Sutter.
      
      2) Add symmetric hash support to nft_hash, from Laura Garcia Liebana.
      
      3) Use pr_cont() in ebt_log, from Joe Perches.
      
      4) Remove some dead code in arp_tables reported via static analysis
         tool, from Colin Ian King.
      
      5) Consolidate nf_tables expression validation, from Liping Zhang.
      
      6) Consolidate set lookup via nft_set_lookup().
      
      7) Remove unnecessary rcu read lock side in bridge netfilter, from
         Florian Westphal.
      
      8) Remove unused variable in nf_reject_ipv4, from Tahee Yoo.
      
      9) Pass nft_ctx struct to object initialization indirections, from
         Florian Westphal.
      
      10) Add code to integrate conntrack helper into nf_tables, also from
          Florian.
      
      11) Allow to check if interface index or name exists via
          NFTA_FIB_F_PRESENT, from Phil Sutter.
      
      12) Simplify resolve_normal_ct(), from Florian.
      
      13) Use per-limit spinlock in nft_limit and xt_limit, from Liping Zhang.
      
      14) Use rwlock in nft_set_rbtree set, also from Liping Zhang.
      
      15) One patch to remove a useless printk at netns init path in ipvs,
          and several patches to document IPVS knobs.
      
      16) Use refcount_t for reference counter in the Netfilter/IPVS code,
          from Elena Reshetova.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41e95736
    • D
      Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · b9974d76
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      1GbE Intel Wired LAN Driver Updates 2017-03-17
      
      This series contains updates to mainly igb, with one fix for ixgbe.
      
      Alex does all the changes in the series, starting with adding support
      for DMA_ATTR_WEAK_ORDERING to improve performance on some platforms.
      Modified igb to use the length of the packet instead of the DD status
      bit to determine if a new descriptor is ready to be processed.  Modified
      the driver to only go through the region in the receive ring that was
      designated to be cleaned up, instead of going through the entire ring
      on cleanup.  Cleaned up the transmit side, by clearing the transmit
      buffer_info only when resetting the rings.  Added a new upper limit for
      receive, which is based on the size of a 2K buffer minus padding, which
      will allow us to support build_skb going forward.  Fixed ethtool testing
      to only sync on the size of the frame that is being tested, instead of
      the entire receive buffer.  Updated the handling of page addresses to
      always use a void pointer with the consistent name of "va" to indicate
      that we are working with a virtual address.  Added a "chicken bit" so
      that we can turn off the new receive allocation feature, in the case
      where we need to fallback to the legacy receive path.  Added support for
      using 3K buffers in order 1 pages the same way we were using 2K buffers
      in 4K pages.  Added support for padding packet, since we limit the size
      of the frame, we are able to write to an offset within the buffer instead
      of having to write at the very start of the buffer.  This allows us to
      leaving padding room for things like supporting XDP in the future.
      Refactored the receive buffer page management, since there are 2-3 paths
      that can be taken depending on what receive modes are enabled, so to
      improve maintainability, break out the common bits into their own
      functions.  Add support for build_skb, again.  Lastly, fixed a typo in
      igb and ixgbe code comments.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b9974d76
  2. 21 3月, 2017 12 次提交
  3. 20 3月, 2017 1 次提交
  4. 18 3月, 2017 14 次提交
  5. 17 3月, 2017 10 次提交
    • R
      netfilter: refcounter conversions · b54ab92b
      Reshetova, Elena 提交于
      refcount_t type and corresponding API (see include/linux/refcount.h)
      should be used instead of atomic_t when the variable is used as
      a reference counter. This allows to avoid accidental
      refcounter overflows that might lead to use-after-free
      situations.
      Signed-off-by: NElena Reshetova <elena.reshetova@intel.com>
      Signed-off-by: NHans Liljestrand <ishkamiel@gmail.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDavid Windsor <dwindsor@gmail.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      b54ab92b
    • M
      liquidio: fix wrong information about link modes reported to ethtool · fe723dff
      Manish Awasthi 提交于
      Information reported to ethtool about link modes is wrong for 25G NIC.  Fix
      it by checking for presence of 25G NIC, checking the link speed reported by
      NIC firmware, and then assigning proper values to the
      ethtool_link_ksettings struct.
      Signed-off-by: NManish Awasthi <manish.awasthi@cavium.com>
      Signed-off-by: NFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fe723dff
    • D
      Merge branch 'netvsc-small-changes' · 513d2d01
      David S. Miller 提交于
      Stephen Hemminger says:
      
      ====================
      netvsc: small changes for net-next
      
      One bugfix, and two non-code patches
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      513d2d01
    • S
      netvsc: remove unused #define · 76f5ed88
      stephen hemminger 提交于
      Not used anywhere.
      Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76f5ed88
    • S
      netvsc: add comments about callback's and NAPI · 262b7f14
      stephen hemminger 提交于
      Add some short description of how callback's and NAPI interoperate.
      Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      262b7f14
    • S
      netvsc: avoid race with callback · 6de38af6
      stephen hemminger 提交于
      Change the argument to channel callback from the channel pointer
      to the internal data structure containing per-channel info.
      This avoids any possible races when callback happens during
      initialization and makes IRQ code simpler.
      Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6de38af6
    • D
      Merge branch 'bpf-inline-lookups' · 3a70418b
      David S. Miller 提交于
      Alexei Starovoitov says:
      
      ====================
      bpf: inline bpf_map_lookup_elem()
      
      bpf_map_lookup_elem() is one of the most frequently used helper functions.
      Improve JITed program performance by inlining this helper.
      
      bpf_map_type	before  after
      hash		58M	74M
      array		174M	280M
      
      The values are number of lookups per second in ideal conditions
      measured by micro-benchmark in patch 6.
      
      The 'perf report' for HASH map type:
      before:
          54.23%  map_perf_test  [kernel.kallsyms]  [k] __htab_map_lookup_elem
          14.24%  map_perf_test  [kernel.kallsyms]  [k] lookup_elem_raw
           8.84%  map_perf_test  [kernel.kallsyms]  [k] htab_map_lookup_elem
           5.93%  map_perf_test  [kernel.kallsyms]  [k] bpf_map_lookup_elem
           2.30%  map_perf_test  [kernel.kallsyms]  [k] bpf_prog_da4fc6a3f41761a2
           1.49%  map_perf_test  [kernel.kallsyms]  [k] kprobe_ftrace_handler
      
      after:
          60.03%  map_perf_test  [kernel.kallsyms]  [k] __htab_map_lookup_elem
          18.07%  map_perf_test  [kernel.kallsyms]  [k] lookup_elem_raw
           2.91%  map_perf_test  [kernel.kallsyms]  [k] bpf_prog_da4fc6a3f41761a2
           1.94%  map_perf_test  [kernel.kallsyms]  [k] _einittext
           1.90%  map_perf_test  [kernel.kallsyms]  [k] __audit_syscall_exit
           1.72%  map_perf_test  [kernel.kallsyms]  [k] kprobe_ftrace_handler
      
      so the cost of htab_map_lookup_elem() and bpf_map_lookup_elem()
      is gone after inlining.
      
      'per-cpu' and 'lru' map types can be optimized similarly in the future.
      
      Note the sparse will complain that bpf is addictive ;)
      kernel/bpf/hashtab.c:438:19: sparse: subtraction of functions? Share your drugs
      kernel/bpf/verifier.c:3342:38: sparse: subtraction of functions? Share your drugs
      it's not a new warning, just in new places.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a70418b
    • A
      samples/bpf: add map_lookup microbenchmark · 95ff141e
      Alexei Starovoitov 提交于
      $ map_perf_test 128
      speed of HASH bpf_map_lookup_elem() in lookups per second
      	w/o JIT		w/JIT
      before	46M		58M
      after	42M		74M
      
      perf report
      before:
          54.23%  map_perf_test  [kernel.kallsyms]  [k] __htab_map_lookup_elem
          14.24%  map_perf_test  [kernel.kallsyms]  [k] lookup_elem_raw
           8.84%  map_perf_test  [kernel.kallsyms]  [k] htab_map_lookup_elem
           5.93%  map_perf_test  [kernel.kallsyms]  [k] bpf_map_lookup_elem
           2.30%  map_perf_test  [kernel.kallsyms]  [k] bpf_prog_da4fc6a3f41761a2
           1.49%  map_perf_test  [kernel.kallsyms]  [k] kprobe_ftrace_handler
      
      after:
          60.03%  map_perf_test  [kernel.kallsyms]  [k] __htab_map_lookup_elem
          18.07%  map_perf_test  [kernel.kallsyms]  [k] lookup_elem_raw
           2.91%  map_perf_test  [kernel.kallsyms]  [k] bpf_prog_da4fc6a3f41761a2
           1.94%  map_perf_test  [kernel.kallsyms]  [k] _einittext
           1.90%  map_perf_test  [kernel.kallsyms]  [k] __audit_syscall_exit
           1.72%  map_perf_test  [kernel.kallsyms]  [k] kprobe_ftrace_handler
      
      Notice that bpf_map_lookup_elem() and htab_map_lookup_elem() are trivial
      functions, yet they take sizeable amount of cpu time.
      htab_map_gen_lookup() removes bpf_map_lookup_elem() and converts
      htab_map_lookup_elem() into three BPF insns which causing cpu time
      for bpf_prog_da4fc6a3f41761a2() slightly increase.
      
      $ map_perf_test 256
      speed of ARRAY bpf_map_lookup_elem() in lookups per second
      	w/o JIT		w/JIT
      before	97M		174M
      after	64M		280M
      
      before:
          37.33%  map_perf_test  [kernel.kallsyms]  [k] array_map_lookup_elem
          13.95%  map_perf_test  [kernel.kallsyms]  [k] bpf_map_lookup_elem
           6.54%  map_perf_test  [kernel.kallsyms]  [k] bpf_prog_da4fc6a3f41761a2
           4.57%  map_perf_test  [kernel.kallsyms]  [k] kprobe_ftrace_handler
      
      after:
          32.86%  map_perf_test  [kernel.kallsyms]  [k] bpf_prog_da4fc6a3f41761a2
           6.54%  map_perf_test  [kernel.kallsyms]  [k] kprobe_ftrace_handler
      
      array_map_gen_lookup() removes calls to array_map_lookup_elem()
      and bpf_map_lookup_elem() and replaces them with 7 bpf insns.
      
      The performance without JIT is slower, since executing extra insns
      in the interpreter is slower than running native C code,
      but with JIT the performance gains are obvious,
      since native C->x86 code is replaced with fewer bpf->x86 instructions.
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      95ff141e
    • A
      bpf: inline htab_map_lookup_elem() · 9015d2f5
      Alexei Starovoitov 提交于
      Optimize:
      bpf_call
        bpf_map_lookup_elem
          map->ops->map_lookup_elem
            htab_map_lookup_elem
              __htab_map_lookup_elem
      into:
      bpf_call
        __htab_map_lookup_elem
      
      to improve performance of JITed programs.
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9015d2f5
    • A
      bpf: add helper inlining infra and optimize map_array lookup · 81ed18ab
      Alexei Starovoitov 提交于
      Optimize bpf_call -> bpf_map_lookup_elem() -> array_map_lookup_elem()
      into a sequence of bpf instructions.
      When JIT is on the sequence of bpf instructions is the sequence
      of native cpu instructions with significantly faster performance
      than indirect call and two function's prologue/epilogue.
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      81ed18ab