1. 03 5月, 2019 1 次提交
  2. 09 4月, 2019 1 次提交
    • L
      RDMA/cm: Move debug counters to be under relevant IB device · c87e65cf
      Leon Romanovsky 提交于
      The sysfs layout is created by CM incorrectly presented RDMA devices with
      InfiniBand link layer. Layout of such devices represents device tree of
      connections. By moving CM statistics to be under relevant port of IB
      device, we will fix the following issues:
      
       * Symlink name - It used device name instead of specific identifier.
       * Target location - It was supposed to point to PCI-ID/infiniband_cm/
         instead of PCI-ID/infiniband/
       * Target name - It created extra device file under already existing
         device folder, e.g. mlx5_0/mlx5_0
       * Crash during boot with RDMA persistent naming patches.
      
       sysfs: cannot create duplicate filename '/class/infiniband_cm/mlx5_0'
       CPU: 29 PID: 433 Comm: modprobe Not tainted 5.0.0-rc5+ #178
       Call Trace:
        dump_stack+0xcc/0x180
        sysfs_warn_dup.cold.3+0x17/0x2d
        sysfs_do_create_link_sd.isra.2+0xd0/0xf0
        device_add+0x7cb/0x1450
        device_create_groups_vargs+0x1ae/0x220
        device_create+0x93/0xc0
        cm_add_one+0x38f/0xf60 [ib_cm]
        add_client_context+0x167/0x210 [ib_core]
        enable_device_and_get+0x230/0x3f0 [ib_core]
        ib_register_device+0x823/0xbf0 [ib_core]
        __mlx5_ib_add+0x45/0x150 [mlx5_ib]
        mlx5_ib_add+0x1b3/0x5e0 [mlx5_ib]
        mlx5_add_device+0x130/0x3a0 [mlx5_core]
        mlx5_register_interface+0x1a9/0x270 [mlx5_core]
        do_one_initcall+0x14f/0x5de
        do_init_module+0x247/0x7c0
        load_module+0x4c2f/0x60d0
        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      After this change:
      [leonro@server ~]$ ls -al /sys/class/infiniband/ibp0s12f0/ports/1/
      drwxr-xr-x  2 root root    0 Mar 11 11:17 cm_rx_duplicates
      drwxr-xr-x  2 root root    0 Mar 11 11:17 cm_rx_msgs
      drwxr-xr-x  2 root root    0 Mar 11 11:17 cm_tx_msgs
      drwxr-xr-x  2 root root    0 Mar 11 11:17 cm_tx_retries
      
      Fixes: 110cf374 ("infiniband: make cm_device use a struct device and not a kobject.")
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      c87e65cf
  3. 29 3月, 2019 2 次提交
  4. 20 2月, 2019 1 次提交
  5. 16 2月, 2019 3 次提交
  6. 15 1月, 2019 2 次提交
  7. 12 12月, 2018 1 次提交
  8. 17 10月, 2018 3 次提交
  9. 27 9月, 2018 1 次提交
  10. 06 9月, 2018 2 次提交
  11. 19 6月, 2018 1 次提交
  12. 04 4月, 2018 1 次提交
    • P
      IB/core: Refactor GID modify code for RoCE · 598ff6ba
      Parav Pandit 提交于
      Code is refactored to prepare separate functions for RoCE which can do more
      complex operations related to reference counting, while still
      maintainining code readability. This includes
      (a) Simplification to not perform netdevice checks and modifications
      for IB link layer.
      (b) Do not add RoCE GID entry which has NULL netdevice; instead return
      an error.
      (c) If GID addition fails at provider level add_gid(), do not add the
      entry in the cache and keep the entry marked as INVALID.
      (d) Simplify and reuse the ib_cache_gid_add()/del() routines so that they
      can be used even for modifying default GIDs. This avoid some code
      duplication in modifying default GIDs.
      (e) find_gid() routine refers to the data entry flags to qualify a GID
      as valid or invalid GID rather than depending on attributes and zeroness
      of the GID content.
      (f) gid_table_reserve_default() sets the GID default attribute at
      beginning while setting up the GID table. There is no need to use
      default_gid flag in low level functions such as write_gid(), add_gid(),
      del_gid(), as they never need to update the DEFAULT property of the GID
      entry while during GID table update.
      
      As as result of this refactor, reserved GID 0:0:0:0:0:0:0:0 is no longer
      searchable as described below.
      
      A unicast GID entry of 0:0:0:0:0:0:0:0 is Reserved GID as per the IB
      spec version 1.3 section 4.1.1, point (6) whose snippet is below.
      
      "The unicast GID address 0:0:0:0:0:0:0:0 is reserved - referred to as
      the Reserved GID. It shall never be assigned to any endport. It shall
      not be used as a destination address or in a global routing header
      (GRH)."
      
      GID table cache now only stores valid GID entries. Before this patch,
      Reserved GID 0:0:0:0:0:0:0:0 was searchable in the GID table using
      ib_find_cached_gid_by_port() and other similar find routines.
      
      Zero GID is no longer searchable as it shall not to be present in GRH or
      path recored entry as described in IB spec version 1.3 section 4.1.1,
      point (6), section 12.7.10 and section 12.7.20.
      
      ib_cache_update() is simplified to check link layer once, use unified
      locking scheme for all link layers, removed temporary gid table
      allocation/free logic.
      
      Additionally,
      (a) Expand ib_gid_attr to store port and index so that GID query
      routines can get port and index information from the attribute structure.
      (b) Expand ib_gid_attr to store device as well so that in future code when
      GID reference counting is done, device is used to reach back to the GID
      table entry.
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      598ff6ba
  13. 28 3月, 2018 1 次提交
  14. 20 3月, 2018 1 次提交
  15. 04 1月, 2018 1 次提交
    • B
      IB/core: Fix two kernel warnings triggered by rxe registration · 02ee9da3
      Bart Van Assche 提交于
      Eliminate the WARN_ONs that create following two warnings when
      registering an rxe device:
      
      WARNING: CPU: 2 PID: 1005 at drivers/infiniband/core/device.c:449 ib_register_device+0x591/0x640 [ib_core]
      CPU: 2 PID: 1005 Comm: run_tests Not tainted 4.15.0-rc4-dbg+ #2
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
      RIP: 0010:ib_register_device+0x591/0x640 [ib_core]
      Call Trace:
       rxe_register_device+0x3c6/0x470 [rdma_rxe]
       rxe_add+0x543/0x5e0 [rdma_rxe]
       rxe_net_add+0x37/0xb0 [rdma_rxe]
       rxe_param_set_add+0x5a/0x120 [rdma_rxe]
       param_attr_store+0x5e/0xc0
       module_attr_store+0x19/0x30
       sysfs_kf_write+0x3d/0x50
       kernfs_fop_write+0x116/0x1a0
       __vfs_write+0x23/0x120
       vfs_write+0xbe/0x1b0
       SyS_write+0x44/0xa0
       entry_SYSCALL_64_fastpath+0x23/0x9a
      
      WARNING: CPU: 2 PID: 1005 at drivers/infiniband/core/sysfs.c:1279 ib_device_register_sysfs+0x11d/0x160 [ib_core]
      CPU: 2 PID: 1005 Comm: run_tests Tainted: G        W        4.15.0-rc4-dbg+ #2
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
      RIP: 0010:ib_device_register_sysfs+0x11d/0x160 [ib_core]
      Call Trace:
       ib_register_device+0x3f7/0x640 [ib_core]
       rxe_register_device+0x3c6/0x470 [rdma_rxe]
       rxe_add+0x543/0x5e0 [rdma_rxe]
       rxe_net_add+0x37/0xb0 [rdma_rxe]
       rxe_param_set_add+0x5a/0x120 [rdma_rxe]
       param_attr_store+0x5e/0xc0
       module_attr_store+0x19/0x30
       sysfs_kf_write+0x3d/0x50
       kernfs_fop_write+0x116/0x1a0
       __vfs_write+0x23/0x120
       vfs_write+0xbe/0x1b0
       SyS_write+0x44/0xa0
       entry_SYSCALL_64_fastpath+0x23/0x9a
      
      The code should accept either a parent pointer or a fully specified DMA
      specification without producing warnings.
      
      Fixes: 99db9494 ("IB/core: Remove ib_device.dma_device")
      Signed-off-by: NBart Van Assche <bart.vanassche@wdc.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: stable@vger.kernel.org # v4.11
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      02ee9da3
  16. 19 10月, 2017 1 次提交
  17. 10 8月, 2017 1 次提交
    • L
      RDMA: Simplify get firmware interface · 9abb0d1b
      Leon Romanovsky 提交于
      There is a need to forward FW version to user space
      application through RDMA netlink. In order to make it safe, there
      is need to declare nla_policy and limit the size of FW string.
      
      The new define IB_FW_VERSION_NAME_MAX will limit the size of
      FW version string. That define was chosen to be equal to
      ETHTOOL_FWVERS_LEN, because many drivers anyway are limited
      by that value indirectly.
      
      The introduction of this define allows us to remove the string size
      from get_fw_str function signature.
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      9abb0d1b
  18. 22 4月, 2017 2 次提交
  19. 25 1月, 2017 1 次提交
  20. 08 10月, 2016 1 次提交
  21. 12 7月, 2016 1 次提交
  22. 24 6月, 2016 1 次提交
  23. 07 6月, 2016 4 次提交
  24. 27 5月, 2016 1 次提交
    • C
      IB/core: Make device counter infrastructure dynamic · b40f4757
      Christoph Lameter 提交于
      In practice, each RDMA device has a unique set of counters that the
      hardware implements.  Having a central set of counters that they must
      all adhere to is limiting and causes many useful counters to not be
      available.
      
      Therefore we create a dynamic counter registration infrastructure.
      
      The driver must implement a stats structure allocation routine, in
      which the driver must place the directory name it wants, a list of
      names for all of the counters, an array of u64 counters themselves,
      plus a few generic configuration options.
      
      We then implement a core routine to create a sysfs file for each
      of the named stats elements, and a core routine to retrieve the
      stats when any of the sysfs attribute files are read.
      
      To avoid excessive beating on the stats generation routine in the
      drivers, the core code also caches the stats for a short period of
      time so that someone attempting to read all of the stats in a
      given device's directory will not result in a stats generation
      call per file read.
      
      Future work will attempt to standardize just the shared stats
      elements, and possibly add a method to get the stats via netlink
      in addition to sysfs.
      Signed-off-by: NChristoph Lameter <cl@linux.com>
      Signed-off-by: NMark Bloch <markb@mellanox.com>
      Reviewed-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      [ Add caching, make structure names more informative, add i40iw support,
        other significant rewrites from the original patch ]
      b40f4757
  25. 12 2月, 2016 1 次提交
  26. 04 2月, 2016 1 次提交
  27. 20 1月, 2016 2 次提交
  28. 24 12月, 2015 1 次提交