1. 24 2月, 2020 1 次提交
  2. 05 2月, 2020 1 次提交
    • J
      devlink: report 0 after hitting end in region read · d5b90e99
      Jacob Keller 提交于
      commit fdd41ec2 ("devlink: Return right error code in case of errors
      for region read") modified the region read code to report errors
      properly in unexpected cases.
      
      In the case where the start_offset and ret_offset match, it unilaterally
      converted this into an error. This causes an issue for the "dump"
      version of the command. In this case, the devlink region dump will
      always report an invalid argument:
      
      000000000000ffd0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      000000000000ffe0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      devlink answers: Invalid argument
      000000000000fff0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      
      This occurs because the expected flow for the dump is to return 0 after
      there is no further data.
      
      The simplest fix would be to stop converting the error code to -EINVAL
      if start_offset == ret_offset. However, avoid unnecessary work by
      checking for when start_offset is larger than the region size and
      returning 0 upfront.
      
      Fixes: fdd41ec2 ("devlink: Return right error code in case of errors for region read")
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d5b90e99
  3. 25 1月, 2020 1 次提交
  4. 19 1月, 2020 3 次提交
  5. 12 1月, 2020 1 次提交
  6. 11 1月, 2020 1 次提交
    • I
      devlink: Wait longer before warning about unset port type · 4c582234
      Ido Schimmel 提交于
      The commit cited below causes devlink to emit a warning if a type was
      not set on a devlink port for longer than 30 seconds to "prevent
      misbehavior of drivers". This proved to be problematic when
      unregistering the backing netdev. The flow is always:
      
      devlink_port_type_clear()	// schedules the warning
      unregister_netdev()		// blocking
      devlink_port_unregister()	// cancels the warning
      
      The call to unregister_netdev() can block for long periods of time for
      various reasons: RTNL lock is contended, large amounts of configuration
      to unroll following dismantle of the netdev, etc. This results in
      devlink emitting a warning despite the driver behaving correctly.
      
      In emulated environments (of future hardware) which are usually very
      slow, the warning can also be emitted during port creation as more than
      30 seconds can pass between the time the devlink port is registered and
      when its type is set.
      
      In addition, syzbot has hit this warning [1] 1974 times since 07/11/19
      without being able to produce a reproducer. Probably because
      reproduction depends on the load or other bugs (e.g., RTNL not being
      released).
      
      To prevent bogus warnings, increase the timeout to 1 hour.
      
      [1] https://syzkaller.appspot.com/bug?id=e99b59e9c024a666c9f7450dc162a4b74d09d9cb
      
      Fixes: 136bf27f ("devlink: add warning in case driver does not set port type")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reported-by: syzbot+b0a18ed7b08b735d2f41@syzkaller.appspotmail.com
      Reported-by: NAlex Veber <alexve@mellanox.com>
      Tested-by: NAlex Veber <alexve@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c582234
  7. 09 1月, 2020 2 次提交
  8. 13 11月, 2019 1 次提交
  9. 12 11月, 2019 2 次提交
  10. 10 11月, 2019 1 次提交
  11. 09 11月, 2019 1 次提交
  12. 08 11月, 2019 2 次提交
  13. 12 10月, 2019 2 次提交
  14. 07 10月, 2019 1 次提交
  15. 06 10月, 2019 2 次提交
  16. 05 10月, 2019 3 次提交
  17. 02 10月, 2019 1 次提交
  18. 14 9月, 2019 2 次提交
  19. 11 9月, 2019 1 次提交
  20. 01 9月, 2019 2 次提交
  21. 18 8月, 2019 2 次提交
    • I
      devlink: Add generic packet traps and groups · 391203ab
      Ido Schimmel 提交于
      Add generic packet traps and groups that can report dropped packets as
      well as exceptions such as TTL error.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      391203ab
    • I
      devlink: Add packet trap infrastructure · 0f420b6c
      Ido Schimmel 提交于
      Add the basic packet trap infrastructure that allows device drivers to
      register their supported packet traps and trap groups with devlink.
      
      Each driver is expected to provide basic information about each
      supported trap, such as name and ID, but also the supported metadata
      types that will accompany each packet trapped via the trap. The
      currently supported metadata type is just the input port, but more will
      be added in the future. For example, output port and traffic class.
      
      Trap groups allow users to set the action of all member traps. In
      addition, users can retrieve per-group statistics in case per-trap
      statistics are too narrow. In the future, the trap group object can be
      extended with more attributes, such as policer settings which will limit
      the amount of traffic generated by member traps towards the CPU.
      
      Beside registering their packet traps with devlink, drivers are also
      expected to report trapped packets to devlink along with relevant
      metadata. devlink will maintain packets and bytes statistics for each
      packet trap and will potentially report the trapped packet with its
      metadata to user space via drop monitor netlink channel.
      
      The interface towards the drivers is simple and allows devlink to set
      the action of the trap. Currently, only two actions are supported:
      'trap' and 'drop'. When set to 'trap', the device is expected to provide
      the sole copy of the packet to the driver which will pass it to devlink.
      When set to 'drop', the device is expected to drop the packet and not
      send a copy to the driver. In the future, more actions can be added,
      such as 'mirror'.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f420b6c
  22. 14 8月, 2019 2 次提交
  23. 10 8月, 2019 1 次提交
  24. 10 7月, 2019 4 次提交