1. 04 6月, 2021 3 次提交
  2. 03 6月, 2021 26 次提交
  3. 01 6月, 2021 1 次提交
  4. 29 5月, 2021 10 次提交
    • S
      i40e: Register auxiliary devices to provide RDMA · f4370a85
      Shiraz Saleem 提交于
      Convert i40e to use the auxiliary bus infrastructure to export
      the RDMA functionality of the device to the RDMA driver.
      Register i40e client auxiliary RDMA device on the auxiliary bus per
      PCIe device function for the new auxiliary rdma driver (irdma) to
      attach to.
      
      The global i40e_register_client and i40e_unregister_client symbols
      will be obsoleted once irdma replaces i40iw in the kernel
      for the X722 device.
      Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      f4370a85
    • S
      i40e: Prep i40e header for aux bus conversion · 9ed75331
      Shiraz Saleem 提交于
      Add the definitions to the i40e client header file in
      preparation to convert i40e to use the new auxiliary bus
      infrastructure. This header is shared between the 'i40e'
      Intel networking driver providing RDMA support and the
      'irdma' driver.
      Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      9ed75331
    • D
      ice: Register auxiliary device to provide RDMA · f9f5301e
      Dave Ertman 提交于
      Register ice client auxiliary RDMA device on the auxiliary bus per
      PCIe device function for the auxiliary driver (irdma) to attach to.
      It allows to realize a single RDMA driver (irdma) capable of working with
      multiple netdev drivers over multi-generation Intel HW supporting RDMA.
      There is no load ordering dependencies between ice and irdma.
      Signed-off-by: NDave Ertman <david.m.ertman@intel.com>
      Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      f9f5301e
    • D
      ice: Implement iidc operations · 348048e7
      Dave Ertman 提交于
      Add implementations for supporting iidc operations for device operation
      such as allocation of resources and event notifications.
      Signed-off-by: NDave Ertman <david.m.ertman@intel.com>
      Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      348048e7
    • D
      ice: Initialize RDMA support · d25a0fc4
      Dave Ertman 提交于
      Probe the device's capabilities to see if it supports RDMA. If so, allocate
      and reserve resources to support its operation; populate structures with
      initial values.
      Signed-off-by: NDave Ertman <david.m.ertman@intel.com>
      Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      d25a0fc4
    • D
      iidc: Introduce iidc.h · e860fa9b
      Dave Ertman 提交于
      Introduce a shared header file used by the 'ice' Intel networking driver
      providing RDMA support and the 'irdma' driver to provide a private
      interface.
      Signed-off-by: NDave Ertman <david.m.ertman@intel.com>
      Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      e860fa9b
    • G
      RDMA/rtrs-clt: Fix memory leak of not-freed sess->stats and stats->pcpu_stats · 7ecd7e29
      Gioh Kim 提交于
      sess->stats and sess->stats->pcpu_stats objects are freed
      when sysfs entry is removed. If something wrong happens and
      session is closed before sysfs entry is created,
      sess->stats and sess->stats->pcpu_stats objects are not freed.
      
      This patch adds freeing of them at three places:
      1. When client uses wrong address and session creation fails.
      2. When client fails to create a sysfs entry.
      3. When client adds wrong address via sysfs add_path.
      
      Fixes: 215378b8 ("RDMA/rtrs: client: sysfs interface functions")
      Link: https://lore.kernel.org/r/20210528113018.52290-21-jinpu.wang@ionos.comSigned-off-by: NGioh Kim <gi-oh.kim@ionos.com>
      Signed-off-by: NJack Wang <jinpu.wang@ionos.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      7ecd7e29
    • M
      RDMA/rtrs-clt: Check if the queue_depth has changed during a reconnection · 5b73b799
      Md Haris Iqbal 提交于
      The queue_depth is a module parameter for rtrs_server. It is used on the
      client side to determing the queue_depth of the request queue for the RNBD
      virtual block device.
      
      During a reconnection event for an already mapped device, in case the
      rtrs_server module queue_depth has changed, fail the reconnect attempt.
      
      Also stop further auto reconnection attempts. A manual reconnect via
      sysfs has to be triggerred.
      
      Fixes: 6a98d71d ("RDMA/rtrs: client: main functionality")
      Link: https://lore.kernel.org/r/20210528113018.52290-20-jinpu.wang@ionos.comSigned-off-by: NMd Haris Iqbal <haris.iqbal@ionos.com>
      Signed-off-by: NGioh Kim <gi-oh.kim@ionos.com>
      Signed-off-by: NJack Wang <jinpu.wang@ionos.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      5b73b799
    • J
      RDMA/rtrs-srv: Fix memory leak when having multiple sessions · 6bb97a2c
      Jack Wang 提交于
      Gioh notice memory leak below
      unreferenced object 0xffff8880acda2000 (size 2048):
        comm "kworker/4:1", pid 77, jiffies 4295062871 (age 1270.730s)
        hex dump (first 32 bytes):
          00 20 da ac 80 88 ff ff 00 20 da ac 80 88 ff ff  . ....... ......
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<00000000e85d85b5>] rtrs_srv_rdma_cm_handler+0x8e5/0xa90 [rtrs_server]
          [<00000000e31a988a>] cma_ib_req_handler+0xdc5/0x2b50 [rdma_cm]
          [<000000000eb02c5b>] cm_process_work+0x2d/0x100 [ib_cm]
          [<00000000e1650ca9>] cm_req_handler+0x11bc/0x1c40 [ib_cm]
          [<000000009c28818b>] cm_work_handler+0xe65/0x3cf2 [ib_cm]
          [<000000002b53eaa1>] process_one_work+0x4bc/0x980
          [<00000000da3499fb>] worker_thread+0x78/0x5c0
          [<00000000167127a4>] kthread+0x191/0x1e0
          [<0000000060802104>] ret_from_fork+0x3a/0x50
      unreferenced object 0xffff88806d595d90 (size 8):
        comm "kworker/4:1H", pid 131, jiffies 4295062972 (age 1269.720s)
        hex dump (first 8 bytes):
          62 6c 61 00 6b 6b 6b a5                          bla.kkk.
        backtrace:
          [<000000004447d253>] kstrdup+0x2e/0x60
          [<0000000047259793>] kobject_set_name_vargs+0x2f/0xb0
          [<00000000c2ee3bc8>] dev_set_name+0xab/0xe0
          [<000000002b6bdfb1>] rtrs_srv_create_sess_files+0x260/0x290 [rtrs_server]
          [<0000000075d87bd7>] rtrs_srv_info_req_done+0x71b/0x960 [rtrs_server]
          [<00000000ccdf1bb5>] __ib_process_cq+0x94/0x100 [ib_core]
          [<00000000cbcb60cb>] ib_cq_poll_work+0x32/0xc0 [ib_core]
          [<000000002b53eaa1>] process_one_work+0x4bc/0x980
          [<00000000da3499fb>] worker_thread+0x78/0x5c0
          [<00000000167127a4>] kthread+0x191/0x1e0
          [<0000000060802104>] ret_from_fork+0x3a/0x50
      unreferenced object 0xffff88806d6bb100 (size 256):
        comm "kworker/4:1H", pid 131, jiffies 4295062972 (age 1269.720s)
        hex dump (first 32 bytes):
          00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00  .....N..........
          ff ff ff ff ff ff ff ff 00 59 4d 86 ff ff ff ff  .........YM.....
        backtrace:
          [<00000000a18a11e4>] device_add+0x74d/0xa00
          [<00000000a915b95f>] rtrs_srv_create_sess_files.cold+0x49/0x1fe [rtrs_server]
          [<0000000075d87bd7>] rtrs_srv_info_req_done+0x71b/0x960 [rtrs_server]
          [<00000000ccdf1bb5>] __ib_process_cq+0x94/0x100 [ib_core]
          [<00000000cbcb60cb>] ib_cq_poll_work+0x32/0xc0 [ib_core]
          [<000000002b53eaa1>] process_one_work+0x4bc/0x980
          [<00000000da3499fb>] worker_thread+0x78/0x5c0
          [<00000000167127a4>] kthread+0x191/0x1e0
          [<0000000060802104>] ret_from_fork+0x3a/0x50
      
      The problem is we increase device refcount by get_device in process_info_req
      for each path, but only does put_deice for last path, which lead to
      memory leak.
      
      To fix it, it also calls put_device when dev_ref is not 0.
      
      Fixes: e2853c49 ("RDMA/rtrs-srv-sysfs: fix missing put_device")
      Link: https://lore.kernel.org/r/20210528113018.52290-19-jinpu.wang@ionos.comSigned-off-by: NGioh Kim <gi-oh.kim@ionos.com>
      Signed-off-by: NJack Wang <jinpu.wang@ionos.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      6bb97a2c
    • G
      RDMA/rtrs-srv: Fix memory leak of unfreed rtrs_srv_stats object · 2371c403
      Gioh Kim 提交于
      When closing a session, currently the rtrs_srv_stats object in the
      closing session is freed by kobject release. But if it failed
      to create a session by various reasons, it must free the rtrs_srv_stats
      object directly because kobject is not created yet.
      
      This problem is found by kmemleak as below:
      
      1. One client machine maps /dev/nullb0 with session name 'bla':
      root@test1:~# echo "sessname=bla path=ip:192.168.122.190 \
      device_path=/dev/nullb0" > /sys/devices/virtual/rnbd-client/ctl/map_device
      
      2. Another machine failed to create a session with the same name 'bla':
      root@test2:~# echo "sessname=bla path=ip:192.168.122.190 \
      device_path=/dev/nullb1" > /sys/devices/virtual/rnbd-client/ctl/map_device
      -bash: echo: write error: Connection reset by peer
      
      3. The kmemleak on server machine reported an error:
      unreferenced object 0xffff888033cdc800 (size 128):
        comm "kworker/2:1", pid 83, jiffies 4295086585 (age 2508.680s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<00000000a72903b2>] __alloc_sess+0x1d4/0x1250 [rtrs_server]
          [<00000000d1e5321e>] rtrs_srv_rdma_cm_handler+0xc31/0xde0 [rtrs_server]
          [<00000000bb2f6e7e>] cma_ib_req_handler+0xdc5/0x2b50 [rdma_cm]
          [<00000000e896235d>] cm_process_work+0x2d/0x100 [ib_cm]
          [<00000000b6866c5f>] cm_req_handler+0x11bc/0x1c40 [ib_cm]
          [<000000005f5dd9aa>] cm_work_handler+0xe65/0x3cf2 [ib_cm]
          [<00000000610151e7>] process_one_work+0x4bc/0x980
          [<00000000541e0f77>] worker_thread+0x78/0x5c0
          [<00000000423898ca>] kthread+0x191/0x1e0
          [<000000005a24b239>] ret_from_fork+0x3a/0x50
      
      Fixes: 39c2d639 ("RDMA/rtrs-srv: Set .release function for rtrs srv device during device init")
      Link: https://lore.kernel.org/r/20210528113018.52290-18-jinpu.wang@ionos.comSigned-off-by: NGioh Kim <gi-oh.kim@ionos.com>
      Signed-off-by: NMd Haris Iqbal <haris.iqbal@ionos.com>
      Signed-off-by: NJack Wang <jinpu.wang@ionos.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      2371c403