1. 18 Jul, 2018 4 commits
    • Jakub Kicinski's avatar
      netdevsim: add switch_id attribute · 5f07655b
      Jakub Kicinski authored
      Grouping netdevsim devices into "ASICs" will soon be supported.
      Add switch_id attribute to all netdevsims.  For now each netdevsim
      will have its switch_id matching the device id.
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      5f07655b
    • Colin Ian King's avatar
      bpf: sockmap: remove redundant pointer sg · c23e014a
      Colin Ian King authored
      Pointer sg is being assigned but is never used hence it is
      redundant and can be removed.
      
      Cleans up clang warning:
      warning: variable 'sg' set but not used [-Wunused-but-set-variable]
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      c23e014a
    • Roman Gushchin's avatar
      bpf: fix rcu annotations in compute_effective_progs() · 3960f4fd
      Roman Gushchin authored
      The progs local variable in compute_effective_progs() is marked
      as __rcu, which is not correct. This is a local pointer, which
      is initialized by bpf_prog_array_alloc(), which also now
      returns a generic non-rcu pointer.
      
      The real rcu-protected pointer is *array (array is a pointer
      to an RCU-protected pointer), so the assignment should be performed
      using rcu_assign_pointer().
      
      Fixes: 324bda9e ("bpf: multi program support for cgroup+bpf")
      Signed-off-by: default avatarRoman Gushchin <guro@fb.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      3960f4fd
    • Roman Gushchin's avatar
      bpf: bpf_prog_array_alloc() should return a generic non-rcu pointer · d29ab6e1
      Roman Gushchin authored
      Currently the return type of the bpf_prog_array_alloc() is
      struct bpf_prog_array __rcu *, which is not quite correct.
      Obviously, the returned pointer is a generic pointer, which
      is valid for an indefinite amount of time and it's not shared
      with anyone else, so there is no sense in marking it as __rcu.
      
      This change eliminate the following sparse warnings:
      kernel/bpf/core.c:1544:31: warning: incorrect type in return expression (different address spaces)
      kernel/bpf/core.c:1544:31:    expected struct bpf_prog_array [noderef] <asn:4>*
      kernel/bpf/core.c:1544:31:    got void *
      kernel/bpf/core.c:1548:17: warning: incorrect type in return expression (different address spaces)
      kernel/bpf/core.c:1548:17:    expected struct bpf_prog_array [noderef] <asn:4>*
      kernel/bpf/core.c:1548:17:    got struct bpf_prog_array *<noident>
      kernel/bpf/core.c:1681:15: warning: incorrect type in assignment (different address spaces)
      kernel/bpf/core.c:1681:15:    expected struct bpf_prog_array *array
      kernel/bpf/core.c:1681:15:    got struct bpf_prog_array [noderef] <asn:4>*
      
      Fixes: 324bda9e ("bpf: multi program support for cgroup+bpf")
      Signed-off-by: default avatarRoman Gushchin <guro@fb.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      d29ab6e1
  2. 16 Jul, 2018 36 commits