1. 24 Aug, 2017 29 commits
  2. 23 Aug, 2017 4 commits
  3. 22 Aug, 2017 7 commits
    • Daniel Borkmann's avatar
      bpf: fix map value attribute for hash of maps · cd36c3a2
      Daniel Borkmann authored
      Currently, iproute2's BPF ELF loader works fine with array of maps
      when retrieving the fd from a pinned node and doing a selfcheck
      against the provided map attributes from the object file, but we
      fail to do the same for hash of maps and thus refuse to get the
      map from pinned node.
      
      Reason is that when allocating hash of maps, fd_htab_map_alloc() will
      set the value size to sizeof(void *), and any user space map creation
      requests are forced to set 4 bytes as value size. Thus, selfcheck
      will complain about exposed 8 bytes on 64 bit archs vs. 4 bytes from
      object file as value size. Contract is that fdinfo or BPF_MAP_GET_FD_BY_ID
      returns the value size used to create the map.
      
      Fix it by handling it the same way as we do for array of maps, which
      means that we leave value size at 4 bytes and in the allocation phase
      round up value size to 8 bytes. alloc_htab_elem() needs an adjustment
      in order to copy rounded up 8 bytes due to bpf_fd_htab_map_update_elem()
      calling into htab_map_update_elem() with the pointer of the map
      pointer as value. Unlike array of maps where we just xchg(), we're
      using the generic htab_map_update_elem() callback also used from helper
      calls, which published the key/value already on return, so we need
      to ensure to memcpy() the right size.
      
      Fixes: bcc6b1b7 ("bpf: Add hash of maps support")
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cd36c3a2
    • Colin Ian King's avatar
      MIPS,bpf: fix missing break in switch statement · 4a00aa05
      Colin Ian King authored
      There is a missing break causing a fall-through and setting
      ctx.use_bbit_insns to the wrong value. Fix this by adding the
      missing break.
      
      Detected with cppcheck:
      "Variable 'ctx.use_bbit_insns' is reassigned a value before the old
      one has been used. 'break;' missing?"
      
      Fixes: 8d8d18c3 ("MIPS,bpf: Fix using smp_processor_id() in preemptible splat.")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Acked-by: default avatarDavid Daney <david.daney@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4a00aa05
    • Eric Dumazet's avatar
      net: sched: use kvmalloc() for class hash tables · 9695fe6f
      Eric Dumazet authored
      High order GFP_KERNEL allocations can stress the host badly.
      
      Use modern kvmalloc_array()/kvfree() instead of custom
      allocations.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9695fe6f
    • Arvind Yadav's avatar
      net: amd: constify zorro_device_id · 153890b4
      Arvind Yadav authored
      zorro_device_id are not supposed to change at runtime. All functions
      working with zorro_device_id provided by <linux/zorro.h> work with
      const zorro_device_id. So mark the non-const structs as const.
      Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      153890b4
    • David S. Miller's avatar
      Merge branch 'net-mvpp2-MAC-GoP-configuration' · 9142b673
      David S. Miller authored
      Antoine Tenart says:
      
      ====================
      net: mvpp2: MAC/GoP configuration
      
      This is based on net-next (e2a7c34f).
      
      I removed the GoP interrupt and PHY optional parts in this v2 to ease
      the review process as the MAC/GoP initialization seemed to start less
      discussions :)
      
      This series now only aims at making the PPv2 driver less depending on
      the firmware/bootloader initialization. Some patches cleanup some parts
      as well, and add new interface descriptions in the dt.
      
      The current implementation of the PPv2 driver relies on the
      firmware/bootloader initialization to configure some parts, as the Group
      of Ports (GoP) and the MACs (GMAC and/or XLG MAC --for 10G--).  The
      drawback is the kernel must be configured to match exactly what the
      bootloader configures which is not convenient and is an issue when using
      boards having an Ethernet port and an SFP port wired to the same GoP
      port, as no dynamic configuration can be done.
      
      This series adds the GoP and GMAC/XLG MAC initializations so that the
      PPV2 does not have to rely on a previous initialization. One part is
      still missing from this series, and that would be the 'comphy' which
      provides shared serdes PHYs and which must be configured as well for a
      full kernel initialization to work. This comphy support will be part of
      a following up series. (This series was also tested with this 'comphy'
      support, as it's nearly ready).
      
      @Dave: patches 9 and 10 should go through the mvebu tree. Thanks!
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9142b673
    • Antoine Ténart's avatar
      Documentation/bindings: net: marvell-pp2: add the system controller · 7afe461e
      Antoine Ténart authored
      This patch documents the new marvell,system-controller property used by
      the Marvell ppv2 network driver.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Tested-by: default avatarMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7afe461e
    • Antoine Ténart's avatar
      net: mvpp2: initialize the GoP · f84bf386
      Antoine Ténart authored
      The patch adds GoP (group of ports) initialization functions. The mvpp2
      driver was relying on the firmware/bootloader initialization; this patch
      moves this setup to the mvpp2 driver.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Tested-by: default avatarMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f84bf386