1. 02 Sep, 2016 11 commits
    • Alexei Starovoitov's avatar
      samples/bpf: add perf_event+bpf example · 1c47910e
      Alexei Starovoitov authored
      The bpf program is called 50 times a second and does hashmap[kern&user_stackid]++
      It's primary purpose to check that key bpf helpers like map lookup, update,
      get_stackid, trace_printk and ctx access are all working.
      It checks:
      - PERF_COUNT_HW_CPU_CYCLES on all cpus
      - PERF_COUNT_HW_CPU_CYCLES for current process and inherited perf_events to children
      - PERF_COUNT_SW_CPU_CLOCK on all cpus
      - PERF_COUNT_SW_CPU_CLOCK for current process
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c47910e
    • Alexei Starovoitov's avatar
      perf, bpf: add perf events core support for BPF_PROG_TYPE_PERF_EVENT programs · aa6a5f3c
      Alexei Starovoitov authored
      Allow attaching BPF_PROG_TYPE_PERF_EVENT programs to sw and hw perf events
      via overflow_handler mechanism.
      When program is attached the overflow_handlers become stacked.
      The program acts as a filter.
      Returning zero from the program means that the normal perf_event_output handler
      will not be called and sampling event won't be stored in the ring buffer.
      
      The overflow_handler_context==NULL is an additional safety check
      to make sure programs are not attached to hw breakpoints and watchdog
      in case other checks (that prevent that now anyway) get accidentally
      relaxed in the future.
      
      The program refcnt is incremented in case perf_events are inhereted
      when target task is forked.
      Similar to kprobe and tracepoint programs there is no ioctl to
      detach the program or swap already attached program. The user space
      expected to close(perf_event_fd) like it does right now for kprobe+bpf.
      That restriction simplifies the code quite a bit.
      
      The invocation of overflow_handler in __perf_event_overflow() is now
      done via READ_ONCE, since that pointer can be replaced when the program
      is attached while perf_event itself could have been active already.
      There is no need to do similar treatment for event->prog, since it's
      assigned only once before it's accessed.
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa6a5f3c
    • Alexei Starovoitov's avatar
      bpf: perf_event progs should only use preallocated maps · fdc15d38
      Alexei Starovoitov authored
      Make sure that BPF_PROG_TYPE_PERF_EVENT programs only use
      preallocated hash maps, since doing memory allocation
      in overflow_handler can crash depending on where nmi got triggered.
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdc15d38
    • Alexei Starovoitov's avatar
      bpf: introduce BPF_PROG_TYPE_PERF_EVENT program type · 0515e599
      Alexei Starovoitov authored
      Introduce BPF_PROG_TYPE_PERF_EVENT programs that can be attached to
      HW and SW perf events (PERF_TYPE_HARDWARE and PERF_TYPE_SOFTWARE
      correspondingly in uapi/linux/perf_event.h)
      
      The program visible context meta structure is
      struct bpf_perf_event_data {
          struct pt_regs regs;
           __u64 sample_period;
      };
      which is accessible directly from the program:
      int bpf_prog(struct bpf_perf_event_data *ctx)
      {
        ... ctx->sample_period ...
        ... ctx->regs.ip ...
      }
      
      The bpf verifier rewrites the accesses into kernel internal
      struct bpf_perf_event_data_kern which allows changing
      struct perf_sample_data without affecting bpf programs.
      New fields can be added to the end of struct bpf_perf_event_data
      in the future.
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0515e599
    • Alexei Starovoitov's avatar
      bpf: support 8-byte metafield access · ea2e7ce5
      Alexei Starovoitov authored
      The verifier supported only 4-byte metafields in
      struct __sk_buff and struct xdp_md. The metafields in upcoming
      struct bpf_perf_event are 8-byte to match register width in struct pt_regs.
      Teach verifier to recognize 8-byte metafield access.
      The patch doesn't affect safety of sockets and xdp programs.
      They check for 4-byte only ctx access before these conditions are hit.
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ea2e7ce5
    • Baoyou Xie's avatar
      mISDN: mark symbols static where possible · 569e937e
      Baoyou Xie authored
      We get a few warnings when building kernel with W=1:
      drivers/isdn/hardware/mISDN/hfcmulti.c:568:1: warning: no previous declaration for 'enablepcibridge' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:574:1: warning: no previous declaration for 'disablepcibridge' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:580:1: warning: no previous declaration for 'readpcibridge' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:608:1: warning: no previous declaration for 'writepcibridge' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:638:1: warning: no previous declaration for 'cpld_set_reg' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:645:1: warning: no previous declaration for 'cpld_write_reg' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:657:1: warning: no previous declaration for 'cpld_read_reg' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:674:1: warning: no previous declaration for 'vpm_write_address' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:681:1: warning: no previous declaration for 'vpm_read_address' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:695:1: warning: no previous declaration for 'vpm_in' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:716:1: warning: no previous declaration for 'vpm_out' [-Wmissing-declarations]
      drivers/isdn/hardware/mISDN/hfcmulti.c:1028:1: warning: no previous declaration for 'plxsd_checksync' [-Wmissing-declarations]
      ....
      
      In fact, these functions are only used in the file in which they are
      declared and don't need a declaration, but can be made static.
      so this patch marks these functions with 'static'.
      Signed-off-by: default avatarBaoyou Xie <baoyou.xie@linaro.org>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      569e937e
    • Timur Tabi's avatar
      net: emac: emac gigabit ethernet controller driver · b9b17deb
      Timur Tabi authored
      Add support for the Qualcomm Technologies, Inc. EMAC gigabit Ethernet
      controller.
      
      This driver supports the following features:
      1) Checksum offload.
      2) Interrupt coalescing support.
      3) SGMII phy.
      4) phylib interface for external phy
      
      Based on original work by
      	Niranjana Vishwanathapura <nvishwan@codeaurora.org>
      	Gilad Avidov <gavidov@codeaurora.org>
      Signed-off-by: default avatarTimur Tabi <timur@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b9b17deb
    • Vivien Didelot's avatar
      net: dsa: remove ds_to_priv · 04bed143
      Vivien Didelot authored
      Access the priv member of the dsa_switch structure directly, instead of
      having an unnecessary helper.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      04bed143
    • David S. Miller's avatar
      Merge branch 'br-next' · 278ed676
      David S. Miller authored
      Nikolay Aleksandrov says:
      
      ====================
      net: bridge: add per-port unknown multicast flood control
      
      The first patch prepares the forwarding path by having the exact packet
      type passed down so we can later filter based on it and the per-port
      unknown mcast flood flag introduced in the second patch. It is similar to
      how the per-port unknown unicast flood flag works.
      Nice side-effects of patch 01 are the slight reduction of tests in the
      fast-path and a few minor checkpatch fixes.
      
      v3: don't change br_auto_mask as that will change user-visible behaviour
      v2: make pkt_type an enum as per Stephen's comment
      ====================
      Acked-by: default avatarStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      278ed676
    • Nikolay Aleksandrov's avatar
      net: bridge: add per-port multicast flood flag · b6cb5ac8
      Nikolay Aleksandrov authored
      Add a per-port flag to control the unknown multicast flood, similar to the
      unknown unicast flood flag and break a few long lines in the netlink flag
      exports.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6cb5ac8
    • Nikolay Aleksandrov's avatar
      net: bridge: change unicast boolean to exact pkt_type · 8addd5e7
      Nikolay Aleksandrov authored
      Remove the unicast flag and introduce an exact pkt_type. That would help us
      for the upcoming per-port multicast flood flag and also slightly reduce the
      tests in the input fast path.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8addd5e7
  2. 01 Sep, 2016 29 commits