1. 19 11月, 2014 4 次提交
    • A
      bpf: add hashtable type of eBPF maps · 0f8e4bd8
      Alexei Starovoitov 提交于
      add new map type BPF_MAP_TYPE_HASH and its implementation
      
      - maps are created/destroyed by userspace. Both userspace and eBPF programs
        can lookup/update/delete elements from the map
      
      - eBPF programs can be called in_irq(), so use spin_lock_irqsave() mechanism
        for concurrent updates
      
      - key/value are opaque range of bytes (aligned to 8 bytes)
      
      - user space provides 3 configuration attributes via BPF syscall:
        key_size, value_size, max_entries
      
      - map takes care of allocating/freeing key/value pairs
      
      - map_update_elem() must fail to insert new element when max_entries
        limit is reached to make sure that eBPF programs cannot exhaust memory
      
      - map_update_elem() replaces elements in an atomic way
      
      - optimized for speed of lookup() which can be called multiple times from
        eBPF program which itself is triggered by high volume of events
        . in the future JIT compiler may recognize lookup() call and optimize it
          further, since key_size is constant for life of eBPF program
      Signed-off-by: NAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f8e4bd8
    • A
      bpf: add 'flags' attribute to BPF_MAP_UPDATE_ELEM command · 3274f520
      Alexei Starovoitov 提交于
      the current meaning of BPF_MAP_UPDATE_ELEM syscall command is:
      either update existing map element or create a new one.
      Initially the plan was to add a new command to handle the case of
      'create new element if it didn't exist', but 'flags' style looks
      cleaner and overall diff is much smaller (more code reused), so add 'flags'
      attribute to BPF_MAP_UPDATE_ELEM command with the following meaning:
       #define BPF_ANY	0 /* create new element or update existing */
       #define BPF_NOEXIST	1 /* create new element if it didn't exist */
       #define BPF_EXIST	2 /* update existing element */
      
      bpf_update_elem(fd, key, value, BPF_NOEXIST) call can fail with EEXIST
      if element already exists.
      
      bpf_update_elem(fd, key, value, BPF_EXIST) can fail with ENOENT
      if element doesn't exist.
      
      Userspace will call it as:
      int bpf_update_elem(int fd, void *key, void *value, __u64 flags)
      {
          union bpf_attr attr = {
              .map_fd = fd,
              .key = ptr_to_u64(key),
              .value = ptr_to_u64(value),
              .flags = flags;
          };
      
          return bpf(BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr));
      }
      
      First two bits of 'flags' are used to encode style of bpf_update_elem() command.
      Bits 2-63 are reserved for future use.
      Signed-off-by: NAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3274f520
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next · 1bbf148d
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2014-11-18
      
      This series contains updates to i40e only.
      
      Shannon provides a patch to clean up the driver to only warn once that
      PTP is not supported when linked at 100Mbps.
      
      Mitch provides a fix for i40e where the VF interrupt processing takes
      a long time and it is possible that we could lose a VFLR event if it
      happens while processing a VFLR on another VF.  To correct this situation,
      we enable the VFLR interrupt cause before we begin processing any pending
      resets.
      
      Neerav provides several patches to update DCB support in i40e.  When
      there are DCB configuration changes based on DCBx, the firmware suspends
      the port's Tx and generates an event to the PF.  The PF is then
      responsible to reconfigure the PF VSIs and switching topology as per the
      updated DCB configuration and then resume the port's Tx by calling the
      "Resume Port Tx" AQ command, so add this call to the flow that handles
      DCB re-configuration in the PF.  Allow the driver to query and use DCB
      configuration from firmware when firmware DCBx agent is in CEE mode.
      Add a check whether LLDP Agent's default AdminStatus is enabled or
      disabled on a given port, and sets DCBx status to disabled if the
      status is disabled.  Fix an issue when the port TC configuration
      changes as a result of DCBx and the driver modifies the enabled TCs for
      the VEBs it manages but does not update the enabled_tc value that
      was cached on a per VEB basis.  Add a new PF state so that if a port's
      Tx is in suspended state the Tx queue disable flow would just put the
      request for the queue to be disabled and return without waiting for the
      queue to be actually disabled.  Allows the driver to enable/disable
      the XPS based on the number of TCs being enabled for the given VSI.
      
      v2: Dropped patch "i40e: Handle a single mss packet with more than 8 frags"
          while we rework the patch after we test a bit more based on feedback from
          Eric Dumazet.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1bbf148d
    • D
      PPC: bpf_jit_comp: Unify BPF_MOD | BPF_X and BPF_DIV | BPF_X · cadaecd2
      Denis Kirjanov 提交于
      Reduce duplicated code by unifying
      BPF_ALU | BPF_MOD | BPF_X and BPF_ALU | BPF_DIV | BPF_X
      
      CC: Alexei Starovoitov<alexei.starovoitov@gmail.com>
      CC: Daniel Borkmann<dborkman@redhat.com>
      CC: Philippe Bergheaud<felix@linux.vnet.ibm.com>
      Signed-off-by: NDenis Kirjanov <kda@linux-powerpc.org>
      Acked-by: NAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cadaecd2
  2. 18 11月, 2014 11 次提交
  3. 17 11月, 2014 23 次提交
  4. 15 11月, 2014 1 次提交
    • J
      Revert "fast_hash: avoid indirect function calls" · a77f9c5d
      Jay Vosburgh 提交于
      This reverts commit e5a2c899.
      
      	Commit e5a2c899 introduced an alternative_call, arch_fast_hash2,
      that selects between __jhash2 and __intel_crc4_2_hash based on the
      X86_FEATURE_XMM4_2.
      
      	Unfortunately, the alternative_call system does not appear to be
      suitable for use with C functions, as register usage is not handled
      properly for the called functions.  The __jhash2 function in particular
      clobbers registers that are not preserved when called via
      alternative_call, resulting in a panic for direct callers of
      arch_fast_hash2 on older CPUs lacking sse4_2.  It is possible that
      __intel_crc4_2_hash works merely by chance because it uses fewer
      registers.
      
      	This commit was suggested as the source of the problem by Jesse
      Gross <jesse@nicira.com>.
      Signed-off-by: NJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a77f9c5d
  5. 14 11月, 2014 1 次提交