1. Nov 28, 2022
  2. Nov 25, 2022
  3. Nov 23, 2022
  4. Nov 22, 2022
  5. Nov 19, 2022
  6. Nov 17, 2022
  7. Nov 16, 2022
  8. Nov 15, 2022
    • Mark Zhang's avatar
      RDMA/nldev: Return "-EAGAIN" if the cm_id isn't from expected port · ecacb375
      Mark Zhang authored
      When filling a cm_id entry, return "-EAGAIN" instead of 0 if the cm_id
      doesn'the have the same port as requested, otherwise an incomplete entry
      may be returned, which causes "rdam res show cm_id" to return an error.
      
      For example on a machine with two rdma devices with "rping -C 1 -v -s"
      running background, the "rdma" command fails:
        $ rdma -V
        rdma utility, iproute2-5.19.0
        $ rdma res show cm_id
        link mlx5_0/- cm-idn 0 state LISTEN ps TCP pid 28056 comm rping src-addr 0.0.0.0:7174
        error: Protocol not available
      
      While with this fix it succeeds:
        $ rdma res show cm_id
        link mlx5_0/- cm-idn 0 state LISTEN ps TCP pid 26395 comm rping src-addr 0.0.0.0:7174
        link mlx5_1/- cm-idn 0 state LISTEN ps TCP pid 26395 comm rping src-addr 0.0.0.0:7174
      
      Fixes: 00313983
      
       ("RDMA/nldev: provide detailed CM_ID information")
      Signed-off-by: default avatarMark Zhang <markzhang@nvidia.com>
      Link: https://lore.kernel.org/r/a08e898cdac5e28428eb749a99d9d981571b8ea7.1667810736.git.leonro@nvidia.com
      
      
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      ecacb375
    • Mark Zhang's avatar
      RDMA/core: Make sure "ib_port" is valid when access sysfs node · 5e15ff29
      Mark Zhang authored
      The "ib_port" structure must be set before adding the sysfs kobject,
      and reset after removing it, otherwise it may crash when accessing
      the sysfs node:
        Unable to handle kernel NULL pointer dereference at virtual address 0000000000000050
        Mem abort info:
          ESR = 0x96000006
          Exception class = DABT (current EL), IL = 32 bits
          SET = 0, FnV = 0
          EA = 0, S1PTW = 0
        Data abort info:
          ISV = 0, ISS = 0x00000006
          CM = 0, WnR = 0
        user pgtable: 4k pages, 48-bit VAs, pgdp = 00000000e85f5ba5
        [0000000000000050] pgd=0000000848fd9003, pud=000000085b387003, pmd=0000000000000000
        Internal error: Oops: 96000006 [#2] PREEMPT SMP
        Modules linked in: ib_umad(O) mlx5_ib(O) nfnetlink_cttimeout(E) nfnetlink(E) act_gact(E) cls_flower(E) sch_ingress(E) openvswitch(E) nsh(E) nf_nat_ipv6(E) nf_nat_ipv4(E) nf_conncount(E) nf_nat(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) mst_pciconf(O) ipmi_devintf(E) ipmi_msghandler(E) ipmb_dev_int(OE) mlx5_core(O) mlxfw(O) mlxdevm(O) auxiliary(O) ib_uverbs(O) ib_core(O) mlx_compat(O) psample(E) sbsa_gwdt(E) uio_pdrv_genirq(E) uio(E) mlxbf_pmc(OE) mlxbf_gige(OE) mlxbf_tmfifo(OE) gpio_mlxbf2(OE) pwr_mlxbf(OE) mlx_trio(OE) i2c_mlxbf(OE) mlx_bootctl(OE) bluefield_edac(OE) knem(O) ip_tables(E) ipv6(E) crc_ccitt(E) [last unloaded: mst_pci]
        Process grep (pid: 3372, stack limit = 0x0000000022055c92)
        CPU: 5 PID: 3372 Comm: grep Tainted: G      D    OE     4.19.161-mlnx.47.gadcd9e3 #1
        Hardware name: https://www.mellanox.com BlueField SoC/BlueField SoC, BIOS BlueField:3.9.2-15-ga2403ab Sep  8 2022
        pstate: 40000005 (nZcv daif -PAN -UAO)
        pc : hw_stat_port_show+0x4c/0x80 [ib_core]
        lr : port_attr_show+0x40/0x58 [ib_core]
        sp : ffff000029f43b50
        x29: ffff000029f43b50 x28: 0000000019375000
        x27: ffff8007b821a540 x26: ffff000029f43e30
        x25: 0000000000008000 x24: ffff000000eaa958
        x23: 0000000000001000 x22: ffff8007a4ce3000
        x21: ffff8007baff8000 x20: ffff8007b9066ac0
        x19: ffff8007bae97578 x18: 0000000000000000
        x17: 0000000000000000 x16: 0000000000000000
        x15: 0000000000000000 x14: 0000000000000000
        x13: 0000000000000000 x12: 0000000000000000
        x11: 0000000000000000 x10: 0000000000000000
        x9 : 0000000000000000 x8 : ffff8007a4ce4000
        x7 : 0000000000000000 x6 : 000000000000003f
        x5 : ffff000000e6a280 x4 : ffff8007a4ce3000
        x3 : 0000000000000000 x2 : aaaaaaaaaaaaaaab
        x1 : ffff8007b9066a10 x0 : ffff8007baff8000
        Call trace:
         hw_stat_port_show+0x4c/0x80 [ib_core]
         port_attr_show+0x40/0x58 [ib_core]
         sysfs_kf_seq_show+0x8c/0x150
         kernfs_seq_show+0x44/0x50
         seq_read+0x1b4/0x45c
         kernfs_fop_read+0x148/0x1d8
         __vfs_read+0x58/0x180
         vfs_read+0x94/0x154
         ksys_read+0x68/0xd8
         __arm64_sys_read+0x28/0x34
         el0_svc_common+0x88/0x18c
         el0_svc_handler+0x78/0x94
         el0_svc+0x8/0xe8
        Code: f2955562 aa1603e4 aa1503e0 f9405683 (f9402861)
      
      Fixes: d8a58838
      
       ("RDMA/core: Replace the ib_port_data hw_stats pointers with a ib_port pointer")
      Signed-off-by: default avatarMark Zhang <markzhang@nvidia.com>
      Reviewed-by: default avatarMichael Guralnik <michaelgur@nvidia.com>
      Link: https://lore.kernel.org/r/88867e705c42c1cd2011e45201c25eecdb9fef94.1667810736.git.leonro@nvidia.com
      
      
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      5e15ff29
    • Mark Zhang's avatar
      RDMA/restrack: Release MR restrack when delete · dac153f2
      Mark Zhang authored
      The MR restrack also needs to be released when delete it, otherwise it
      cause memory leak as the task struct won't be released.
      
      Fixes: 13ef5539
      
       ("RDMA/restrack: Count references to the verbs objects")
      Signed-off-by: default avatarMark Zhang <markzhang@nvidia.com>
      Reviewed-by: default avatarMichael Guralnik <michaelgur@nvidia.com>
      Link: https://lore.kernel.org/r/703db18e8d4ef628691fb93980a709be673e62e3.1667810736.git.leonro@nvidia.com
      
      
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      dac153f2
  9. Nov 14, 2022
  10. Nov 11, 2022