1. 25 8月, 2017 4 次提交
  2. 24 8月, 2017 27 次提交
  3. 23 8月, 2017 9 次提交
    • W
      gre: fix goto statement typo · e3d0328c
      William Tu 提交于
      Fix typo: pnet_tap_faied.
      Signed-off-by: NWilliam Tu <u9012063@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3d0328c
    • D
      Merge branch 'bpf-minor-cleanups' · 572a5767
      David S. Miller 提交于
      Daniel Borkmann says:
      
      ====================
      Two minor BPF cleanups
      
      Two minor cleanups on devmap and redirect I still had
      in my queue.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      572a5767
    • D
      bpf: minor cleanups for dev_map · af4d045c
      Daniel Borkmann 提交于
      Some minor code cleanups, while going over it I also noticed that
      we're accounting the bitmap only for one CPU currently, so fix that
      up as well.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af4d045c
    • D
      bpf: misc xdp redirect cleanups · e4a8e817
      Daniel Borkmann 提交于
      Few cleanups including: bpf_redirect_map() is really XDP only due to
      the return code. Move it to a more appropriate location where we do
      the XDP redirect handling and change it's name into bpf_xdp_redirect_map()
      to make it consistent to the bpf_xdp_redirect() helper.
      
      xdp_do_redirect_map() helper can be static since only used out of filter.c
      file. Drop the goto in xdp_do_generic_redirect() and only return errors
      directly. In xdp_do_flush_map() only clear ri->map_to_flush which is the
      arg we're using in that function, ri->map is cleared earlier along with
      ri->ifindex.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e4a8e817
    • D
      bpf: fix map value attribute for hash of maps · cd36c3a2
      Daniel Borkmann 提交于
      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: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cd36c3a2
    • C
      MIPS,bpf: fix missing break in switch statement · 4a00aa05
      Colin Ian King 提交于
      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: NColin Ian King <colin.king@canonical.com>
      Acked-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a00aa05
    • E
      net: sched: use kvmalloc() for class hash tables · 9695fe6f
      Eric Dumazet 提交于
      High order GFP_KERNEL allocations can stress the host badly.
      
      Use modern kvmalloc_array()/kvfree() instead of custom
      allocations.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9695fe6f
    • A
      net: amd: constify zorro_device_id · 153890b4
      Arvind Yadav 提交于
      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: NArvind Yadav <arvind.yadav.cs@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      153890b4
    • D
      Merge branch 'net-mvpp2-MAC-GoP-configuration' · 9142b673
      David S. Miller 提交于
      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: NDavid S. Miller <davem@davemloft.net>
      9142b673