1. 06 Sep, 2016 9 commits
    • Joe Perches's avatar
      hso: Use a more common logging style · 95a69117
      Joe Perches authored
      Macros that end in an underscore are just odd.
      Add hso_dbg(level, fmt, ...) and use it everwhere instead.
      
      Several uses had additional unnecessary newlines as the
      macro added a newline.  Remove the newline from the macro
      and add newlines to each use as appropriate.
      
      Remove now unused D<digit> macros.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      95a69117
    • Woojung Huh's avatar
      smsc95xx: Add mdix control via ethtool · 13722bbe
      Woojung Huh authored
      Add mdix control through ethtool.
      Signed-off-by: default avatarWoojung Huh <Woojung.huh@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13722bbe
    • Woojung Huh's avatar
      smsc95xx: Add register define · 273bf288
      Woojung Huh authored
      Add STRAP_STATUS defines.
      Signed-off-by: default avatarWoojung Huh <Woojung.huh@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      273bf288
    • Woojung Huh's avatar
      smsc95xx: Add maintainer · 983ccd74
      Woojung Huh authored
      Add Microchip Linux Driver Support as maintainer
      because this driver is maintaining by Microchip.
      Signed-off-by: default avatarWoojung Huh <Woojung.huh@gmail.com>
      Acked-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      983ccd74
    • David S. Miller's avatar
      Merge branch 'mv88e6xxx-isolate-Global2' · 464520a1
      David S. Miller authored
      Vivien Didelot says:
      
      ====================
      net: dsa: mv88e6xxx: isolate Global2 support
      
      Registers of Marvell chips are organized in internal SMI devices.
      
      One of them at address 0x1C is called Global2. It provides an extended
      set of registers, used for interrupt control, EEPROM access, indirect
      PHY access (to bypass the PHY Polling Unit) and cross-chip setup.
      
      Most chips have it, but some others don't (older ones such as 6060).
      
      Now that its related code is isolated in mv88e6xxx_g2_* functions, move
      it to its own global2.c file, making most of its setup code static.
      
      Then make its compilation optional, which allows to reduce the size of
      the mv88e6xxx driver for devices such as home routers embedding Ethernet
      chips without Global2 support.
      
      It is present on most recent chips, thus enable its support by default.
      
      Changes in v2: fail probe if GLOBAL2 is required but not enabled.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      464520a1
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: make global2 code optional · ca070c10
      Vivien Didelot authored
      Since not every chip has a Global2 set of registers, make its support
      optional, in which case the related functions will return -EOPNOTSUPP.
      
      This also allows to reduce the size of the mv88e6xxx driver for devices
      such as home routers embedding Ethernet chips without Global2 support.
      
      It is present on most recent chips, thus enable its support by default.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca070c10
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: move Global2 code · ec561276
      Vivien Didelot authored
      Marvell chips are composed of multiple SMI devices. One of them at
      address 0x1C is called Global2. It provides an extended set of
      registers, used for interrupt control, EEPROM access, indirect PHY
      access (to bypass the PHY Polling Unit) and cross-chip related setup.
      
      Most chips have it, but some others don't (older ones such as 6060).
      
      Now that its related code is isolated in mv88e6xxx_g2_* functions, move
      it to its own global2.c file, making most of its setup code static.
      Document each registers in the meantime.
      
      Its compilation can be later avoided for chips without such registers.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ec561276
    • Vivien Didelot's avatar
      net: dsa: mv88e6xxx: fix module naming · 6654d0bf
      Vivien Didelot authored
      Since the mv88e6xxx.c file has been renamed, the driver compiled as a
      module is called chip.ko instead of mv88e6xxx.ko. Fix this.
      
      Fixes: fad09c73 ("net: dsa: mv88e6xxx: rename single-chip support")
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6654d0bf
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next · 60175ccd
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter updates for net-next
      
      The following patchset contains Netfilter updates for your net-next
      tree.  Most relevant updates are the removal of per-conntrack timers to
      use a workqueue/garbage collection approach instead from Florian
      Westphal, the hash and numgen expression for nf_tables from Laura
      Garcia, updates on nf_tables hash set to honor the NLM_F_EXCL flag,
      removal of ip_conntrack sysctl and many other incremental updates on our
      Netfilter codebase.
      
      More specifically, they are:
      
      1) Retrieve only 4 bytes to fetch ports in case of non-linear skb
         transport area in dccp, sctp, tcp, udp and udplite protocol
         conntrackers, from Gao Feng.
      
      2) Missing whitespace on error message in physdev match, from Hangbin Liu.
      
      3) Skip redundant IPv4 checksum calculation in nf_dup_ipv4, from Liping Zhang.
      
      4) Add nf_ct_expires() helper function and use it, from Florian Westphal.
      
      5) Replace opencoded nf_ct_kill() call in IPVS conntrack support, also
         from Florian.
      
      6) Rename nf_tables set implementation to nft_set_{name}.c
      
      7) Introduce the hash expression to allow arbitrary hashing of selector
         concatenations, from Laura Garcia Liebana.
      
      8) Remove ip_conntrack sysctl backward compatibility code, this code has
         been around for long time already, and we have two interfaces to do
         this already: nf_conntrack sysctl and ctnetlink.
      
      9) Use nf_conntrack_get_ht() helper function whenever possible, instead
         of opencoding fetch of hashtable pointer and size, patch from Liping Zhang.
      
      10) Add quota expression for nf_tables.
      
      11) Add number generator expression for nf_tables, this supports
          incremental and random generators that can be combined with maps,
          very useful for load balancing purpose, again from Laura Garcia Liebana.
      
      12) Fix a typo in a debug message in FTP conntrack helper, from Colin Ian King.
      
      13) Introduce a nft_chain_parse_hook() helper function to parse chain hook
          configuration, this is used by a follow up patch to perform better chain
          update validation.
      
      14) Add rhashtable_lookup_get_insert_key() to rhashtable and use it from the
          nft_set_hash implementation to honor the NLM_F_EXCL flag.
      
      15) Missing nulls check in nf_conntrack from nf_conntrack_tuple_taken(),
          patch from Florian Westphal.
      
      16) Don't use the DYING bit to know if the conntrack event has been already
          delivered, instead a state variable to track event re-delivery
          states, also from Florian.
      
      17) Remove the per-conntrack timer, use the workqueue approach that was
          discussed during the NFWS, from Florian Westphal.
      
      18) Use the netlink conntrack table dump path to kill stale entries,
          again from Florian.
      
      19) Add a garbage collector to get rid of stale conntracks, from
          Florian.
      
      20) Reschedule garbage collector if eviction rate is high.
      
      21) Get rid of the __nf_ct_kill_acct() helper.
      
      22) Use ARPHRD_ETHER instead of hardcoded 1 from ARP logger.
      
      23) Make nf_log_set() interface assertive on unsupported families.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60175ccd
  2. 04 Sep, 2016 6 commits
  3. 03 Sep, 2016 16 commits
  4. 02 Sep, 2016 9 commits
    • Rosen, Rami's avatar
      switchdev: Fix return value of switchdev_port_fdb_dump(). · dd19bde3
      Rosen, Rami authored
      This patch fixes the retun value of switchdev_port_fdb_dump() when
      CONFIG_NET_SWITCHDEV is not set. This avoids getting "warning: return makes
      integer from pointer without a cast [-Wint-conversion]" when building
      when CONFIG_NET_SWITCHDEV is not set under several compiler versions.
      This warning is due to commit d297653d
      ("rtnetlink: fdb dump: optimize by saving last interface markers").
      Signed-off-by: default avatarRami Rosen <rami.rosen@intel.com>
      Acked-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Reported-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dd19bde3
    • David S. Miller's avatar
      Merge branch 'bpf-perf-hw-sw-events' · 4df20483
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      perf, bpf: add support for bpf in sw/hw perf_events
      
      this patch set is a follow up to the discussion:
      https://lkml.kernel.org/r/20160804142853.GO6862%20()%20twins%20!%20programming%20!%20kicks-ass%20!%20net
      It turned out to be simpler than what we discussed.
      
      Patches 1-3 is bpf-side prep for the main patch 4
      that adds bpf program as an overflow_handler to sw and hw perf_events.
      
      Patches 5 and 6 are examples from myself and Brendan.
      
      Peter,
      to implement your suggestion to add ifdef CONFIG_BPF_SYSCALL
      inside struct perf_event, I had to shuffle ifdefs in events/core.c
      Please double check whether that is what you wanted to see.
      
      v2->v3: fixed few more minor issues
      v1->v2: fixed issues spotted by Peter and Daniel.
      ====================
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4df20483
    • Brendan Gregg's avatar
      samples/bpf: add sampleip example · 72874418
      Brendan Gregg authored
      sample instruction pointer and frequency count in a BPF map
      Signed-off-by: default avatarBrendan Gregg <bgregg@netflix.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      72874418
    • 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