An error occurred fetching the project authors.
  1. 01 Jun, 2020 6 commits
  2. 15 May, 2020 1 commit
  3. 04 May, 2020 3 commits
  4. 01 May, 2020 1 commit
    • Jakub Kicinski's avatar
      devlink: fix return value after hitting end in region read · 610a9346
      Jakub Kicinski authored
      Commit d5b90e99 ("devlink: report 0 after hitting end in region read")
      fixed region dump, but region read still returns a spurious error:
      
      $ devlink region read netdevsim/netdevsim1/dummy snapshot 0 addr 0 len 128
      0000000000000000 a6 f4 c4 1c 21 35 95 a6 9d 34 c3 5b 87 5b 35 79
      0000000000000010 f3 a0 d7 ee 4f 2f 82 7f c6 dd c4 f6 a5 c3 1b ae
      0000000000000020 a4 fd c8 62 07 59 48 03 70 3b c7 09 86 88 7f 68
      0000000000000030 6f 45 5d 6d 7d 0e 16 38 a9 d0 7a 4b 1e 1e 2e a6
      0000000000000040 e6 1d ae 06 d6 18 00 85 ca 62 e8 7e 11 7e f6 0f
      0000000000000050 79 7e f7 0f f3 94 68 bd e6 40 22 85 b6 be 6f b1
      0000000000000060 af db ef 5e 34 f0 98 4b 62 9a e3 1b 8b 93 fc 17
      devlink answers: Invalid argument
      0000000000000070 61 e8 11 11 66 10 a5 f7 b1 ea 8d 40 60 53 ed 12
      
      This is a minimal fix, I'll follow up with a restructuring
      so we don't have two checks for the same condition.
      
      Fixes: fdd41ec2 ("devlink: Return right error code in case of errors for region read")
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      610a9346
  5. 31 Mar, 2020 3 commits
    • Ido Schimmel's avatar
      devlink: Allow setting of packet trap group parameters · c064875a
      Ido Schimmel authored
      The previous patch allowed device drivers to publish their default
      binding between packet trap policers and packet trap groups. However,
      some users might not be content with this binding and would like to
      change it.
      
      In case user space passed a packet trap policer identifier when setting
      a packet trap group, invoke the appropriate device driver callback and
      pass the new policer identifier.
      
      v2:
      * Check for presence of 'DEVLINK_ATTR_TRAP_POLICER_ID' in
        devlink_trap_group_set() and bail if not present
      * Add extack error message in case trap group was partially modified
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c064875a
    • Ido Schimmel's avatar
      devlink: Add packet trap group parameters support · f9f54392
      Ido Schimmel authored
      Packet trap groups are used to aggregate logically related packet traps.
      Currently, these groups allow user space to batch operations such as
      setting the trap action of all member traps.
      
      In order to prevent the CPU from being overwhelmed by too many trapped
      packets, it is desirable to bind a packet trap policer to these groups.
      For example, to limit all the packets that encountered an exception
      during routing to 10Kpps.
      
      Allow device drivers to bind default packet trap policers to packet trap
      groups when the latter are registered with devlink.
      
      The next patch will enable user space to change this default binding.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9f54392
    • Ido Schimmel's avatar
      devlink: Add packet trap policers support · 1e8c6619
      Ido Schimmel authored
      Devices capable of offloading the kernel's datapath and perform
      functions such as bridging and routing must also be able to send (trap)
      specific packets to the kernel (i.e., the CPU) for processing.
      
      For example, a device acting as a multicast-aware bridge must be able to
      trap IGMP membership reports to the kernel for processing by the bridge
      module.
      
      In most cases, the underlying device is capable of handling packet rates
      that are several orders of magnitude higher compared to those that can
      be handled by the CPU.
      
      Therefore, in order to prevent the underlying device from overwhelming
      the CPU, devices usually include packet trap policers that are able to
      police the trapped packets to rates that can be handled by the CPU.
      
      This patch allows capable device drivers to register their supported
      packet trap policers with devlink. User space can then tune the
      parameters of these policer (currently, rate and burst size) and read
      from the device the number of packets that were dropped by the policer,
      if supported.
      
      Subsequent patches in the series will allow device drivers to create
      default binding between these policers and packet trap groups and allow
      user space to change the binding.
      
      v2:
      * Add 'strict_start_type' in devlink policy
      * Have device drivers provide max/min rate/burst size for each policer.
        Use them to check validity of user provided parameters
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1e8c6619
  6. 30 Mar, 2020 3 commits
  7. 27 Mar, 2020 9 commits
  8. 26 Mar, 2020 1 commit
    • Parav Pandit's avatar
      devlink: Rely on driver eswitch thread safety instead of devlink · 98fed6eb
      Parav Pandit authored
      devlink_nl_cmd_eswitch_set_doit() doesn't hold devlink->lock mutex while
      invoking driver callback. This is likely due to eswitch mode setting
      involves adding/remove devlink ports, health reporters or
      other devlink objects for a devlink device.
      
      So it is driver responsiblity to ensure thread safe eswitch state
      transition happening via either sriov legacy enablement or via devlink
      eswitch set callback.
      
      Therefore, get() callback should also be invoked without holding
      devlink->lock mutex.
      Vendor driver can use same internal lock which it uses during eswitch
      mode set() callback.
      This makes get() and set() implimentation symmetric in devlink core and
      in vendor drivers.
      
      Hence, remove holding devlink->lock mutex during eswitch get() callback.
      
      Failing to do so results into below deadlock scenario when mlx5_core
      driver is improved to handle eswitch mode set critical section invoked
      by devlink and sriov sysfs interface in subsequent patch.
      
      devlink_nl_cmd_eswitch_set_doit()
         mlx5_eswitch_mode_set()
           mutex_lock(esw->mode_lock) <- Lock A
           [...]
           register_devlink_port()
             mutex_lock(&devlink->lock); <- lock B
      
      mutex_lock(&devlink->lock); <- lock B
      devlink_nl_cmd_eswitch_get_doit()
         mlx5_eswitch_mode_get()
         mutex_lock(esw->mode_lock) <- Lock A
      
      In subsequent patch, mlx5_core driver uses its internal lock during
      get() and set() eswitch callbacks.
      
      Other drivers have been inspected which returns either constant during
      get operations or reads the value from already allocated structure.
      Hence it is safe to remove the lock in get( ) callback and let vendor
      driver handle it.
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Reviewed-by: default avatarMark Bloch <markb@mellanox.com>
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      98fed6eb
  9. 24 Mar, 2020 3 commits
  10. 03 Mar, 2020 3 commits
  11. 28 Feb, 2020 1 commit
  12. 27 Feb, 2020 1 commit
  13. 25 Feb, 2020 2 commits
  14. 24 Feb, 2020 2 commits
  15. 19 Feb, 2020 1 commit