1. 20 10月, 2016 7 次提交
  2. 19 10月, 2016 12 次提交
  3. 18 10月, 2016 21 次提交
    • D
      Merge branch 'phy-led-triggers' · a8446676
      David S. Miller 提交于
      Zach Brown says:
      
      ====================
      Add support for led triggers on phy link state change
      
      Fix skge driver that declared enum contants that conflicted with enum
      constants in linux/leds.h
      
      Create function that encapsulates actions taken during the adjust phy link step
      of phy state changes.
      
      Create function that provides list of speeds currently supported by the phy.
      
      Add support for led triggers on phy link state changes by adding
      a config option. When set the config option will create a set of led triggers
      for each phy device. Users can use the led triggers to represent link state
      changes on the phy.
      
      v2:
       * New patch that creates phy_adjust_link function to encapsulate actions taken
         when adjusting phy link during phy state changes
       * led trigger speed strings changed to match existing phy speed strings
       * New function that maps speeds to led triggers
       * Replace magic constants with definitions when declaring trigger name
         buffer and number of triggers.
      v3:
       * Changed LED_ON to LED_REG_ON in skge driver to avoid possible future
         conflict and improve consistency.
       * Dropped rtl8712 patch that was accepted separately.
      v4:
       * tweaked commit message
      v5
       * Changed commit message to explain relationship between the new triggers and
         leds driven by phys.
       * Added new patch that creates phy_supported_speeds function.
       * Moved phy_leds_triggers_register and phy_leds_triggers_unregister to
         phy_attach and phy_detach respectively. This change is so the
         phydev->supported field will be filled by the time the triggers are
         registered.
       * Changed hardcoded list of triggers to dynamic list determined by speeds
         return by phy_supported_speeds.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8446676
    • Z
      net: phy: leds: add support for led triggers on phy link state change · 2e0bc452
      Zach Brown 提交于
      Create an option CONFIG_LED_TRIGGER_PHY (default n), which will create a
      set of led triggers for each instantiated PHY device. There is one LED
      trigger per link-speed, per-phy.
      The triggers are registered during phy_attach and unregistered during
      phy_detach.
      
      This allows for a user to configure their system to allow a set of LEDs
      not controlled by the phy to represent link state changes on the phy.
      LEDS controlled by the phy are unaffected.
      
      For example, we have a board where some of the leds in the
      RJ45 socket are controlled by the phy, but others are not. Using the
      triggers provided by this patch the leds not controlled by the phy can
      be configured to show the current speed of the ethernet connection. The
      leds controlled by the phy are unaffected.
      Signed-off-by: NJosh Cartwright <josh.cartwright@ni.com>
      Signed-off-by: NNathan Sullivan <nathan.sullivan@ni.com>
      Signed-off-by: NZach Brown <zach.brown@ni.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e0bc452
    • Z
      net: phy: Create phy_supported_speeds function which lists speeds currently... · 1f9127ca
      Zach Brown 提交于
      net: phy: Create phy_supported_speeds function which lists speeds currently supported by a phydevice
      
      phy_supported_speeds provides a means to get a list of all the speeds a
      phy device currently supports.
      Signed-off-by: NZach Brown <zach.brown@ni.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f9127ca
    • Z
      net: phy: Encapsulate actions performed during link state changes into function phy_adjust_link · 61a17965
      Zach Brown 提交于
      During phy state machine state transitions some set of actions should
      occur whenever the link state changes. These actions should be
      encapsulated into a single function
      
      This patch adds the phy_adjust_link function, which is called whenever
      phydev->adjust_link would have been called before. Actions that should
      occur whenever the phy link is adjusted can now be added to the
      phy_adjust_link function.
      Signed-off-by: NZach Brown <zach.brown@ni.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61a17965
    • Z
      skge: Rename LED_OFF and LED_ON in marvel skge driver to avoid conflicts with leds namespace · 0e0f27dd
      Zach Brown 提交于
      Adding led support for phy causes namespace conflicts for some
      phy drivers.
      
      The marvel skge driver declared an enum for representing the states of
      Link LED Register. The enum contained constant LED_OFF which conflicted
      with declartation found in linux/leds.h.
      LED_OFF changed to LED_REG_OFF
      Also changed LED_ON to LED_REG_ON to avoid possible future conflict and
      for consistency.
      Signed-off-by: NZach Brown <zach.brown@ni.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0e0f27dd
    • D
      Merge branch 'netdev-adjacency' · 5bb61cb5
      David S. Miller 提交于
      David Ahern says:
      
      ====================
      net: Fix netdev adjacency tracking
      
      The netdev adjacency tracking is failing to create proper dependencies
      for some topologies. For example this topology
      
              +--------+
              |  myvrf |
              +--------+
                |    |
                |  +---------+
                |  | macvlan |
                |  +---------+
                |    |
            +----------+
            |  bridge  |
            +----------+
                |
            +--------+
            | bond1  |
            +--------+
                |
            +--------+
            |  eth3  |
            +--------+
      
      hits 1 of 2 problems depending on the order of enslavement. The base set of
      commands for both cases:
      
          ip link add bond1 type bond
          ip link set bond1 up
          ip link set eth3 down
          ip link set eth3 master bond1
          ip link set eth3 up
      
          ip link add bridge type bridge
          ip link set bridge up
          ip link add macvlan link bridge type macvlan
          ip link set macvlan up
      
          ip link add myvrf type vrf table 1234
          ip link set myvrf up
      
          ip link set bridge master myvrf
      
      Case 1 enslave macvlan to the vrf before enslaving the bond to the bridge:
      
          ip link set macvlan master myvrf
          ip link set bond1 master bridge
      
      Attempts to delete the VRF:
          ip link delete myvrf
      
      trigger the BUG in __netdev_adjacent_dev_remove:
      
      [  587.405260] tried to remove device eth3 from myvrf
      [  587.407269] ------------[ cut here ]------------
      [  587.408918] kernel BUG at /home/dsa/kernel.git/net/core/dev.c:5661!
      [  587.411113] invalid opcode: 0000 [#1] SMP
      [  587.412454] Modules linked in: macvlan bridge stp llc bonding vrf
      [  587.414765] CPU: 0 PID: 726 Comm: ip Not tainted 4.8.0+ #109
      [  587.416766] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
      [  587.420241] task: ffff88013ab6eec0 task.stack: ffffc90000628000
      [  587.422163] RIP: 0010:[<ffffffff813cef03>]  [<ffffffff813cef03>] __netdev_adjacent_dev_remove+0x40/0x12c
      ...
      [  587.446053] Call Trace:
      [  587.446424]  [<ffffffff813d1542>] __netdev_adjacent_dev_unlink+0x20/0x3c
      [  587.447390]  [<ffffffff813d16a3>] netdev_upper_dev_unlink+0xfa/0x15e
      [  587.448297]  [<ffffffffa00003a3>] vrf_del_slave+0x13/0x2a [vrf]
      [  587.449153]  [<ffffffffa00004a4>] vrf_dev_uninit+0xea/0x114 [vrf]
      [  587.450036]  [<ffffffff813d19b0>] rollback_registered_many+0x22b/0x2da
      [  587.450974]  [<ffffffff813d1aac>] unregister_netdevice_many+0x17/0x48
      [  587.451903]  [<ffffffff813de444>] rtnl_delete_link+0x3c/0x43
      [  587.452719]  [<ffffffff813dedcd>] rtnl_dellink+0x180/0x194
      
      When the BUG is converted to a WARN_ON it shows 4 missing adjacencies:
        eth3 - myvrf, mvrf - eth3, bond1 - myvrf and myvrf - bond1
      
      All of those are because the __netdev_upper_dev_link function does not
      properly link macvlan lower devices to myvrf when it is enslaved.
      
      The second case just flips the ordering of the enslavements:
          ip link set bond1 master bridge
          ip link set macvlan master myvrf
      
      Then run:
          ip link delete bond1
          ip link delete myvrf
      
      The vrf delete command hangs because myvrf has a reference that has not
      been released. In this case the removal code does not account for 2 paths
      between eth3 and myvrf - one from bridge to vrf and the other through the
      macvlan.
      
      Rather than try to maintain a linked list of all upper and lower devices
      per netdevice, only track the direct neighbors. The remaining stack can
      be determined by recursively walking the neighbors.
      
      The existing netdev_for_each_all_upper_dev_rcu,
      netdev_for_each_all_lower_dev and netdev_for_each_all_lower_dev_rcu macros
      are replaced with APIs that walk the upper and lower device lists. The
      new APIs take a callback function and a data arg that is passed to the
      callback for each device in the list. Drivers using the old macros are
      converted in separate patches to make it easier on reviewers. It is an
      API conversion only; no functional change is intended.
      
      v3
      - address Stephen's comment to simplify logic and remove typecasts
      
      v2
      - fixed bond0 references in cover-letter
      - fixed definition of netdev_next_lower_dev_rcu to mirror the upper_dev
        version.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5bb61cb5
    • D
      net: dev: Improve debug statements for adjacency tracking · 67b62f98
      David Ahern 提交于
      Adjacency code only has debugs for the insert case. Add debugs for
      the remove path and make both consistently worded to make it easier
      to follow the insert and removal with reference counts.
      
      In addition, change the BUG to a WARN_ON. A missing adjacency at
      removal time is not cause for a panic.
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      67b62f98
    • D
      net: Add warning if any lower device is still in adjacency list · 0f524a80
      David Ahern 提交于
      Lower list should be empty just like upper.
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f524a80
    • D
      net: Remove all_adj_list and its references · f1170fd4
      David Ahern 提交于
      Only direct adjacencies are maintained. All upper or lower devices can
      be learned via the new walk API which recursively walks the adj_list for
      upper devices or lower devices.
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f1170fd4
    • D
      rocker: Flip to the new dev walk API · cf2d6740
      David Ahern 提交于
      Convert rocker to the new dev walk API. This is just a code conversion;
      no functional change is intended.
      
      v2
      - removed typecast of data
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cf2d6740
    • D
      mlxsw: Flip to the new dev walk API · dd82364c
      David Ahern 提交于
      Convert mlxsw users to new dev walk API. This is just a code conversion;
      no functional change is intended.
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dd82364c
    • D
      ixgbe: Flip to the new dev walk API · 1cd127fc
      David Ahern 提交于
      Convert ixgbe users to new dev walk API. This is just a code conversion;
      no functional change is intended.
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1cd127fc
    • D
      IB/ipoib: Flip to new dev walk API · e0e79c8e
      David Ahern 提交于
      Convert ipoib_get_net_dev_match_addr to the new upper device walk API.
      This is just a code conversion; no functional change is intended.
      
      v2
      - removed typecast of data
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0e79c8e
    • D
      IB/core: Flip to the new dev walk API · 453d3932
      David Ahern 提交于
      Convert rdma_is_upper_dev_rcu, handle_netdev_upper and
      ipoib_get_net_dev_match_addr to the new upper device walk API.
      This is just a code conversion; no functional change is intended.
      
      v2
      - removed typecast of data
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      453d3932
    • D
      net: bonding: Flip to the new dev walk API · b3208b20
      David Ahern 提交于
      Convert alb_send_learning_packets and bond_has_this_ip to use the new
      netdev_walk_all_upper_dev_rcu API. In both cases this is just a code
      conversion; no functional change is intended.
      
      v2
      - removed typecast of data and simplified bond_upper_dev_walk
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b3208b20
    • D
      net: Introduce new api for walking upper and lower devices · 1a3f060c
      David Ahern 提交于
      This patch introduces netdev_walk_all_upper_dev_rcu,
      netdev_walk_all_lower_dev and netdev_walk_all_lower_dev_rcu. These
      functions recursively walk the adj_list of devices to determine all upper
      and lower devices.
      
      The functions take a callback function that is invoked for each device
      in the list. If the callback returns non-0, the walk is terminated and
      the functions return that code back to callers.
      
      v3
      - simplified netdev_has_upper_dev_all_rcu and __netdev_has_upper_dev and
        removed typecast as suggested by Stephen
      
      v2
      - fixed definition of netdev_next_lower_dev_rcu to mirror the upper_dev
        version.
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a3f060c
    • D
      net: Remove refnr arg when inserting link adjacencies · 790510d9
      David Ahern 提交于
      Commit 93409033 ("net: Add netdev all_adj_list refcnt propagation to
      fix panic") propagated the refnr to insert and remove functions tracking
      the netdev adjacency graph. However, for the insert path the refnr can
      only be 1. Accordingly, remove the refnr argument to make that clear.
      ie., the refnr arg in 93409033 was only needed for the remove path.
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      790510d9
    • D
      Merge branch 'bpf-selftests' · 5921a0fc
      David S. Miller 提交于
      Daniel Borkmann says:
      
      ====================
      Move to BPF selftests
      
      This set improves the test_verifier and test_maps suite and moves
      it over to a new BPF selftest directory, so we can keep improving
      it under kernel selftest umbrella. This also integrates a test
      script for checking test_bpf.ko under various JIT options.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5921a0fc
    • D
      bpf: add initial suite for selftests · 5aa5bd14
      Daniel Borkmann 提交于
      Add a start of a test suite for kernel selftests. This moves test_verifier
      and test_maps over to tools/testing/selftests/bpf/ along with various
      code improvements and also adds a script for invoking test_bpf module.
      The test suite can simply be run via selftest framework, f.e.:
      
        # cd tools/testing/selftests/bpf/
        # make
        # make run_tests
      
      Both test_verifier and test_maps were kind of misplaced in samples/bpf/
      directory and we were looking into adding them to selftests for a while
      now, so it can be picked up by kbuild bot et al and hopefully also get
      more exposure and thus new test case additions.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5aa5bd14
    • D
      bpf: add various tests around spill/fill of regs · 1a776b9c
      Daniel Borkmann 提交于
      Add several spill/fill tests. Besides others, one that performs xadd
      on the spilled register, one ldx/stx test where different types are
      spilled from two branches and read out from common path. Verfier does
      handle all correctly.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a776b9c
    • D
      Merge branch 'ethernet-use-core-min-max-mtu' · 1441dc99
      David S. Miller 提交于
      Jarod Wilson says:
      
      ====================
      ethernet: use core min/max MTU checking
      
      Now that the network stack core min/max MTU checking infrastructure is in
      place, time to start making drivers use it. We'll start with the easiest
      ones, the ethernet drivers, split roughly by vendor, with a catch-all
      patch at the end.
      
      For the most part, every patch does the same essential thing: removes the
      MTU range checking from the drivers' ndo_change_mtu function, puts those
      ranges into the core net_device min_mtu and max_mtu fields, and where
      possible, removes ndo_change_mtu functions entirely.
      
      These patches have all been built through the 0-day build infrastructure
      provided by Intel, on top of net-next as of October 17.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1441dc99