1. 09 7月, 2019 1 次提交
  2. 19 6月, 2019 1 次提交
  3. 03 5月, 2019 2 次提交
  4. 23 4月, 2019 1 次提交
  5. 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
  6. 29 3月, 2019 4 次提交
  7. 20 2月, 2019 1 次提交
    • J
      RDMA/device: Add ib_device_set_netdev() as an alternative to get_netdev · c2261dd7
      Jason Gunthorpe 提交于
      The associated netdev should not actually be very dynamic, so for most
      drivers there is no reason for a callback like this. Provide an API to
      inform the core code about the net dev affiliation and use a core
      maintained data structure instead.
      
      This allows the core code to be more aware of the ndev relationship which
      will allow some new APIs based around this.
      
      This also uses locking that makes some kind of sense, many drivers had a
      confusing RCU lock, or missing locking which isn't right.
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      c2261dd7
  8. 16 2月, 2019 1 次提交
  9. 09 2月, 2019 2 次提交
  10. 22 1月, 2019 1 次提交
  11. 19 1月, 2019 1 次提交
  12. 15 1月, 2019 1 次提交
  13. 19 12月, 2018 1 次提交
  14. 12 12月, 2018 1 次提交
  15. 23 11月, 2018 2 次提交
    • P
      RDMA/core: Sync unregistration with netlink commands · 01b67117
      Parav Pandit 提交于
      When the rdma device is getting removed, get resource info can race with
      device removal, as below:
      
            CPU-0                                  CPU-1
          --------                               --------
          rdma_nl_rcv_msg()
             nldev_res_get_cq_dumpit()
                mutex_lock(device_lock);
                get device reference
                mutex_unlock(device_lock);        [..]
                                                  ib_unregister_device()
                                                  /* Valid reference to
                                                   * device->dev exists.
                                                   */
                                                   ib_dealloc_device()
      
                [..]
                provider->fill_res_entry();
      
      Even though device object is not freed, fill_res_entry() can get called on
      device which doesn't have a driver anymore. Kernel core device reference
      count is not sufficient, as this only keeps the structure valid, and
      doesn't guarantee the driver is still loaded.
      
      Similar race can occur with device renaming and device removal, where
      device_rename() tries to rename a unregistered device. While this is fine
      for devices of a class which are not net namespace aware, but it is
      incorrect for net namespace aware class coming in subsequent series.  If a
      class is net namespace aware, then the below [1] call trace is observed in
      above situation.
      
      Therefore, to avoid the race, keep a reference count and let device
      unregistration wait until all netlink users drop the reference.
      
      [1] Call trace:
      kernfs: ns required in 'infiniband' for 'mlx5_0'
      WARNING: CPU: 18 PID: 44270 at fs/kernfs/dir.c:842 kernfs_find_ns+0x104/0x120
      libahci i2c_core mlxfw libata dca [last unloaded: devlink]
      RIP: 0010:kernfs_find_ns+0x104/0x120
      Call Trace:
      kernfs_find_and_get_ns+0x2e/0x50
      sysfs_rename_link_ns+0x40/0xb0
      device_rename+0xb2/0xf0
      ib_device_rename+0xb3/0x100 [ib_core]
      nldev_set_doit+0x165/0x190 [ib_core]
      rdma_nl_rcv_msg+0x249/0x250 [ib_core]
      ? netlink_deliver_tap+0x8f/0x3e0
      rdma_nl_rcv+0xd6/0x120 [ib_core]
      netlink_unicast+0x17c/0x230
      netlink_sendmsg+0x2f0/0x3e0
      sock_sendmsg+0x30/0x40
      __sys_sendto+0xdc/0x160
      
      Fixes: da5c8507 ("RDMA/nldev: add driver-specific resource tracking")
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      01b67117
    • P
      RDMA/cma: Move cma module specific functions to cma_priv.h · eeb8df87
      Parav Pandit 提交于
      Currently several rdma_cm module specific functions are declared in
      core_priv.h file. Now that we have cma_priv.h file specific to rdma_cm
      kernel module, move them from core_priv.h to cma_priv.h
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      eeb8df87
  16. 17 10月, 2018 2 次提交
  17. 13 9月, 2018 4 次提交
  18. 16 8月, 2018 1 次提交
  19. 30 5月, 2018 1 次提交
  20. 16 3月, 2018 2 次提交
  21. 17 2月, 2018 2 次提交
  22. 30 1月, 2018 2 次提交
  23. 11 1月, 2018 1 次提交
    • H
      IB/core: Increase number of char device minors · 8cf12d77
      Huy Nguyen 提交于
      There is a need to increase number of possible char devices to support
      large number of SR-IOV instances. The current limit is in the range of
      64-128 devices/ports. Increase it to support up to 1024.
      
      The patch performs the following steps to refactor the code:
      1. Removes the split bitmap for fixed and overflow dev numbers.
      2. Pre-allocates the non-legacy major number range during driver
         initialization, choosen for simplicity.
      3. Add new define (RDMA_MAX_PORTS) that is shared between all drivers.
         This is the maximum total number of ports on all struct ib_devices.
      4. Set RDMA_MAX_PORTS to 1024.
      Signed-off-by: NHuy Nguyen <huyn@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      8cf12d77
  24. 09 1月, 2018 2 次提交
    • D
      {net, IB}/mlx5: Manage port association for multiport RoCE · 32f69e4b
      Daniel Jurgens 提交于
      When mlx5_ib_add is called determine if the mlx5 core device being
      added is capable of dual port RoCE operation. If it is, determine
      whether it is a master device or a slave device using the
      num_vhca_ports and affiliate_nic_vport_criteria capabilities.
      
      If the device is a slave, attempt to find a master device to affiliate it
      with. Devices that can be affiliated will share a system image guid. If
      none are found place it on a list of unaffiliated ports. If a master is
      found bind the port to it by configuring the port affiliation in the NIC
      vport context.
      
      Similarly when mlx5_ib_remove is called determine the port type. If it's
      a slave port, unaffiliate it from the master device, otherwise just
      remove it from the unaffiliated port list.
      
      The IB device is registered as a multiport device, even if a 2nd port is
      not available for affiliation. When the 2nd port is affiliated later the
      GID cache must be refreshed in order to get the default GIDs for the 2nd
      port in the cache. Export roce_rescan_device to provide a mechanism to
      refresh the cache after a new port is bound.
      
      In a multiport configuration all IB object (QP, MR, PD, etc) related
      commands should flow through the master mlx5_core_dev, other commands
      must be sent to the slave port mlx5_core_mdev, an interface is provide
      to get the correct mdev for non IB object commands.
      Signed-off-by: NDaniel Jurgens <danielj@mellanox.com>
      Reviewed-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      32f69e4b
    • D
      IB/core: Change roce_rescan_device to return void · 908d6460
      Daniel Jurgens 提交于
      It always returns 0. Change return type to void.
      Signed-off-by: NDaniel Jurgens <danielj@mellanox.com>
      Reviewed-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      908d6460
  25. 03 1月, 2018 1 次提交
  26. 28 12月, 2017 1 次提交