Skip to content
  1. Nov 19, 2014
    • David S. Miller's avatar
      Merge tag 'linux-can-next-for-3.19-20141117' of git://gitorious.org/linux-can/linux-can-next · 66425a7f
      David S. Miller authored
      
      
      Marc Kleine-Budde says:
      
      ====================
      this is a pull request of 9 patches for net-next/master.
      
      All 9 patches are by Roger Quadros and update the c_can platform
      driver. First by improving the initialization sequence of the message
      RAM, making use of syscon/regmap. In the later patches support for
      various TI SoCs is added.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      66425a7f
    • David S. Miller's avatar
      Merge branch 'fec-next' · 970efef4
      David S. Miller authored
      
      
      Lothar Waßmann says:
      
      ====================
      net: fec: assorted cleanup patches
      
      This patch series is a followup to:
      <1415350967-2238-1-git-send-email-LW@KARO-electronics.de>
      [PATCHv4 1/1] net: fec: fix regression on i.MX28 introduced by rx_copybreak support
      to apply the cleanup patches that were originally sent along with the
      bugfix patch.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      970efef4
    • Lothar Waßmann's avatar
      net: fec: remove unused return value from swap_buffer() · c20e599b
      Lothar Waßmann authored
      
      
      The return value of swap_buffer() is not used by any caller, thus
      remove it.
      
      Signed-off-by: default avatarLothar Waßmann <LW@KARO-electronics.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c20e599b
    • Lothar Waßmann's avatar
      net: fec: simplify loop counter handling in swap_buffer() · 7b487d07
      Lothar Waßmann authored
      
      
      Eliminate the DIV_ROUND_UP() and change the loop counter increment to
      4 instead. This results in saving 6 instructions in the functions
      assembly code.
      
      Signed-off-by: default avatarLothar Waßmann <LW@KARO-electronics.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b487d07
    • Lothar Waßmann's avatar
      net: fec: use swab32s() instead of cpu_to_be32() · e453789a
      Lothar Waßmann authored
      
      
      when swap_buffer() is being called, we know for sure, that we need to
      byte swap the data. Furthermore, this function is called for swapping
      data in both directions. Thus cpu_to_be32() is semantically not
      correct for all use cases. Use swab32s() to reflect this.
      
      Signed-off-by: default avatarLothar Waßmann <LW@KARO-electronics.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e453789a
    • Lothar Waßmann's avatar
    • Lothar Waßmann's avatar
      net: fec: change type of 'bufdesc_ex' to bool · 217b5844
      Lothar Waßmann authored
      
      
      fep->bufdesc_ex is treated as a boolean value, thus declare it as
      such.
      
      Signed-off-by: default avatarLothar Waßmann <LW@KARO-electronics.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      217b5844
    • Lothar Waßmann's avatar
    • Lothar Waßmann's avatar
    • Lothar Waßmann's avatar
      net: fec: indentation cleanup · ea209de3
      Lothar Waßmann authored
      
      
      consistently use TABs for indentation
      
      Signed-off-by: default avatarLothar Waßmann <LW@KARO-electronics.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ea209de3
    • David S. Miller's avatar
      Merge branch 'ebpf_maps' · 9a9f9dd7
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      implementation of eBPF maps
      
      v1->v2:
      renamed flags for MAP_UPDATE_ELEM command to be more concise,
      clarified commit logs and improved comments in patches 1,3,7
      per discussions with Daniel
      
      Old v1 cover:
      
      this set of patches adds implementation of HASH and ARRAY types of eBPF maps
      which were described in manpage in commit b4fc1a46
      
      ("Merge branch 'bpf-next'")
      
      The difference vs previous version of these patches from August:
      - added 'flags' attribute to BPF_MAP_UPDATE_ELEM
      - in HASH type implementation removed per-map kmem_cache.
        I was doing kmem_cache_create() for every map to enable selective slub
        debugging to check for overflows and leaks. Now it's not needed, so just
        use normal kmalloc() for map elements.
      - added ARRAY type which was mentioned in manpage, but wasn't public yet
      - added map testsuite and removed temporary bits from test_stubs
      
      Note, eBPF programs cannot be attached to events yet.
      It will come in the next set.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9a9f9dd7
    • Alexei Starovoitov's avatar
      bpf: remove test map scaffolding and user proper types · 7943c0f3
      Alexei Starovoitov authored
      
      
      proper types and function helpers are ready. Use them in verifier testsuite.
      Remove temporary stubs
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7943c0f3
    • Alexei Starovoitov's avatar
      bpf: allow eBPF programs to use maps · d0003ec0
      Alexei Starovoitov authored
      
      
      expose bpf_map_lookup_elem(), bpf_map_update_elem(), bpf_map_delete_elem()
      map accessors to eBPF programs
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0003ec0
    • Alexei Starovoitov's avatar
      bpf: add a testsuite for eBPF maps · ffb65f27
      Alexei Starovoitov authored
      
      
      . check error conditions and sanity of hash and array map APIs
      . check large maps (that kernel gracefully switches to vmalloc from kmalloc)
      . check multi-process parallel access and stress test
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ffb65f27
    • Alexei Starovoitov's avatar
      bpf: fix BPF_MAP_LOOKUP_ELEM command return code · a1854d6a
      Alexei Starovoitov authored
      fix errno of BPF_MAP_LOOKUP_ELEM command as bpf manpage
      described it in commit b4fc1a46
      
      ("Merge branch 'bpf-next'"):
      -----
      BPF_MAP_LOOKUP_ELEM
          int bpf_lookup_elem(int fd, void *key, void *value)
          {
              union bpf_attr attr = {
                  .map_fd = fd,
                  .key = ptr_to_u64(key),
                  .value = ptr_to_u64(value),
              };
      
              return bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));
          }
          bpf() syscall looks up an element with given key in  a  map  fd.
          If  element  is found it returns zero and stores element's value
          into value.  If element is not found  it  returns  -1  and  sets
          errno to ENOENT.
      
      and further down in manpage:
      
         ENOENT For BPF_MAP_LOOKUP_ELEM or BPF_MAP_DELETE_ELEM,  indicates  that
                element with given key was not found.
      -----
      
      In general all BPF commands return ENOENT when map element is not found
      (including BPF_MAP_GET_NEXT_KEY and BPF_MAP_UPDATE_ELEM with
       flags == BPF_MAP_UPDATE_ONLY)
      
      Subsequent patch adds a testsuite to check return values for all of
      these combinations.
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1854d6a
    • Alexei Starovoitov's avatar
      bpf: add array type of eBPF maps · 28fbcfa0
      Alexei Starovoitov authored
      
      
      add new map type BPF_MAP_TYPE_ARRAY and its implementation
      
      - optimized for fastest possible lookup()
        . in the future verifier/JIT may recognize lookup() with constant key
          and optimize it into constant pointer. Can optimize non-constant
          key into direct pointer arithmetic as well, since pointers and
          value_size are constant for the life of the eBPF program.
          In other words array_map_lookup_elem() may be 'inlined' by verifier/JIT
          while preserving concurrent access to this map from user space
      
      - two main use cases for array type:
        . 'global' eBPF variables: array of 1 element with key=0 and value is a
          collection of 'global' variables which programs can use to keep the state
          between events
        . aggregation of tracing events into fixed set of buckets
      
      - all array elements pre-allocated and zero initialized at init time
      
      - key as an index in array and can only be 4 byte
      
      - map_delete_elem() returns EINVAL, since elements cannot be deleted
      
      - map_update_elem() replaces elements in an non-atomic way
        (for atomic updates hashtable type should be used instead)
      
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      28fbcfa0
    • Alexei Starovoitov's avatar
      bpf: add hashtable type of eBPF maps · 0f8e4bd8
      Alexei Starovoitov authored
      
      
      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: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0f8e4bd8
    • Alexei Starovoitov's avatar
      bpf: add 'flags' attribute to BPF_MAP_UPDATE_ELEM command · 3274f520
      Alexei Starovoitov authored
      
      
      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: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3274f520
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next · 1bbf148d
      David S. Miller authored
      
      
      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: default avatarDavid S. Miller <davem@davemloft.net>
      1bbf148d
    • Denis Kirjanov's avatar
      PPC: bpf_jit_comp: Unify BPF_MOD | BPF_X and BPF_DIV | BPF_X · cadaecd2
      Denis Kirjanov authored
      
      
      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: default avatarDenis Kirjanov <kda@linux-powerpc.org>
      Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cadaecd2
  2. Nov 18, 2014
  3. Nov 17, 2014