1. 08 3月, 2018 2 次提交
    • Z
      IB/rxe: remove unnecessary skb_clone · 86af6176
      Zhu Yanjun 提交于
      In send_atomic_ack function, it is not necessary to make a
      skb_clone. To gain better performance (high throughput and
      low latency), this skb_clone is removed.
      
      The following tests are made.
      
       server                       client
      ---------                    ---------
      |1.1.1.1|<----rxe-channel--->|1.1.1.2|
      ---------                    ---------
      
      On server: rping -s -a 1.1.1.1 -v -C 1000 -S 512
      On client: rping -c -a 1.1.1.1 -v -C 1000 -S 512
      
      The kernel config CONFIG_DEBUG_KMEMLEAK is enabled on both server
      and client.
      
      This test runs for several hours. There is no memory leak and the whole
      system can work well.
      
      Based on the above network, the following tests are made.
      
      Server: ibv_rc_pingpong -d rxe0 -g 1
      Client: ibv_rc_pingpong -d rxe0 -g 1 1.1.1.1
      
      The test results on Server(10 tests are made).
      Before:
      Throughput is 137.07 Mbit/sec
      Latency is 517.76 usec/iter
      
      After:
      Throughput is 148.85 Mbit/sec
      Latency is 476.64 usec/iter
      
      The throughput is enhanced and the latency is reduced.
      
      CC: Srinivas Eeda <srinivas.eeda@oracle.com>
      CC: Junxiao Bi <junxiao.bi@oracle.com>
      Signed-off-by: NZhu Yanjun <yanjun.zhu@oracle.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      86af6176
    • B
      IB/srpt: Add RDMA/CM support · 63cf1a90
      Bart Van Assche 提交于
      Add a parameter for configuring the port on which the ib_srpt driver
      listens for incoming RDMA/CM connections, namely
      /sys/kernel/config/target/srpt/discovery_auth/rdma_cm_port. The default
      value for this parameter is 0 which means "do not listen for incoming
      RDMA/CM connections". Add RDMA/CM support to all code that handles
      connection state changes. Modify srpt_init_nodeacl() such that ACLs can
      be configured for IPv4 and IPv6 addresses.
      
      Note: incoming connection requests are only accepted for ports that
      have been enabled. See also the "if (!sport->enabled)" code in the
      connection request handler. See also the following configfs attribute:
      /sys/kernel/config/target/srpt/$port/$port/enable.
      Signed-off-by: NBart Van Assche <bart.vanassche@wdc.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      63cf1a90
  2. 07 3月, 2018 11 次提交
    • G
      RDMA/bnxt_re/qplib_sp: Use true and false for boolean values · 63231585
      Gustavo A. R. Silva 提交于
      Assign true or false to boolean variables instead of an integer value.
      
      This issue was detected with the help of Coccinelle.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Acked-by: NSelvin Xavier <selvin.xavier@broadcom.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      63231585
    • S
      IB/srp: Use the IB_DEVICE_SG_GAPS_REG HCA feature if supported · fbd36818
      Sergey Gorenko 提交于
      If a HCA supports the SG_GAPS_REG feature then fewer memory regions
      are required per command. This patch reduces the number of memory
      regions that is allocated per SRP session.
      Signed-off-by: NSergey Gorenko <sergeygo@mellanox.com>
      Reviewed-by: NMax Gurtovoy <maxg@mellanox.com>
      Tested-by: NLaurence Oberman <loberman@redhat.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Acked-by: NBart Van Assche <bart.vanassche@wdc.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      fbd36818
    • B
      IB/hfi1: Add a missing rcu_read_unlock() · 41904439
      Bart Van Assche 提交于
      This patch avoids that sparse reports the following:
      
      drivers/infiniband/hw/hfi1/driver.c:251:13: warning: context imbalance in 'rcv_hdrerr' - different lock contexts for basic block
      Signed-off-by: NBart Van Assche <bart.vanassche@wdc.com>
      Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
      Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      41904439
    • A
      infiniband: hw: Drop unnecessary continue · 666fe24b
      Arushi 提交于
      Continue at the bottom of a loop are removed.
      Issue found using drop_continue.cocci Coccinelle script.
      Signed-off-by: NArushi Singhal <arushisinghal19971997@gmail.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      666fe24b
    • S
      i40iw: Implement get_vector_affinity API · 7e952b19
      Shiraz Saleem 提交于
      Storage ULPs (like NVMEoF) benefit from exposing affinity mapping
      per completion vector to find the optimal multi-queue affinity
      assignments. The ULPs call the verbs API ib_get_vector_affinity
      introduced in commit c66cd353 ("RDMA/core: expose affinity mappings per
      completion vector") to get the underlying devices affinity mappings.
      
      Add support in driver to expose the affinity masks per MSI-X
      completion vector.
      Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      7e952b19
    • S
      i40iw: Improve CM node lookup time on connection setup · 7de8b357
      Shiraz Saleem 提交于
      Currently all CM nodes involved in a connection are
      maintained in a connected_node list per dev. During
      connection setup, we need to search this every time
      we receive a packet on the iWARP LAN Queue (ILQ) and
      this can be pretty inefficient for large number of
      connections.
      
      Fix this by organizing the CM nodes in two lists -
      accelerated list and non-accelerated list. The search
      on ILQ receive would be limited to only non accelerated
      nodes. When a node moves to RTS, it is added to the
      accelerated list.
      
      Benchmarking ucmatose 16k connections shows a 20%
      improvement in test completion time.
      Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      7de8b357
    • M
      i40iw: Refactor handling of txpend list · 6b0c549f
      Mustafa Ismail 提交于
      Currently the TX pending lists for IEQ and ILQ are
      handled separately. The handling of both can be
      consolidated in i40iw_poll_completion.
      Signed-off-by: NMustafa Ismail <mustafa.ismail@intel.com>
      Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      6b0c549f
    • B
      IB/srpt: Fix an out-of-bounds stack access in srpt_zerolength_write() · 2a78cb4d
      Bart Van Assche 提交于
      Avoid triggering an out-of-bounds stack access by changing the type
      of 'wr' from ib_send_wr into ib_rdma_wr.
      
      This patch fixes the following KASAN bug report:
      
      BUG: KASAN: stack-out-of-bounds in rxe_post_send+0x7a9/0x9a0 [rdma_rxe]
      Read of size 8 at addr ffff880068197a48 by task kworker/2:1/44
      
      Workqueue: ib_cm cm_work_handler [ib_cm]
      Call Trace:
       dump_stack+0x8e/0xcd
       print_address_description+0x6f/0x280
       kasan_report+0x25a/0x380
       __asan_load8+0x54/0x90
       rxe_post_send+0x7a9/0x9a0 [rdma_rxe]
       srpt_zerolength_write+0xf0/0x180 [ib_srpt]
       srpt_cm_rtu_recv+0x68/0x110 [ib_srpt]
       srpt_rdma_cm_handler+0xbb/0x15b [ib_srpt]
       cma_ib_handler+0x1aa/0x4a0 [rdma_cm]
       cm_process_work+0x30/0x100 [ib_cm]
       cm_work_handler+0xa86/0x351b [ib_cm]
       process_one_work+0x475/0x9f0
       worker_thread+0x69/0x690
       kthread+0x1ad/0x1d0
       ret_from_fork+0x3a/0x50
      
      Fixes: aaf45bd8 ("IB/srpt: Detect session shutdown reliably")
      Signed-off-by: NBart Van Assche <bart.vanassche@wdc.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      2a78cb4d
    • B
      RDMA/rxe: Fix an out-of-bounds read · a6544a62
      Bart Van Assche 提交于
      This patch avoids that KASAN reports the following when the SRP initiator
      calls srp_post_send():
      
      ==================================================================
      BUG: KASAN: stack-out-of-bounds in rxe_post_send+0x5c4/0x980 [rdma_rxe]
      Read of size 8 at addr ffff880066606e30 by task 02-mq/1074
      
      CPU: 2 PID: 1074 Comm: 02-mq Not tainted 4.16.0-rc3-dbg+ #1
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
      Call Trace:
      dump_stack+0x85/0xc7
      print_address_description+0x65/0x270
      kasan_report+0x231/0x350
      rxe_post_send+0x5c4/0x980 [rdma_rxe]
      srp_post_send.isra.16+0x149/0x190 [ib_srp]
      srp_queuecommand+0x94d/0x1670 [ib_srp]
      scsi_dispatch_cmd+0x1c2/0x550 [scsi_mod]
      scsi_queue_rq+0x843/0xa70 [scsi_mod]
      blk_mq_dispatch_rq_list+0x143/0xac0
      blk_mq_do_dispatch_ctx+0x1c5/0x260
      blk_mq_sched_dispatch_requests+0x2bf/0x2f0
      __blk_mq_run_hw_queue+0xdb/0x160
      __blk_mq_delay_run_hw_queue+0xba/0x100
      blk_mq_run_hw_queue+0xf2/0x190
      blk_mq_sched_insert_request+0x163/0x2f0
      blk_execute_rq+0xb0/0x130
      scsi_execute+0x14e/0x260 [scsi_mod]
      scsi_probe_and_add_lun+0x366/0x13d0 [scsi_mod]
      __scsi_scan_target+0x18a/0x810 [scsi_mod]
      scsi_scan_target+0x11e/0x130 [scsi_mod]
      srp_create_target+0x1522/0x19e0 [ib_srp]
      kernfs_fop_write+0x180/0x210
      __vfs_write+0xb1/0x2e0
      vfs_write+0xf6/0x250
      SyS_write+0x99/0x110
      do_syscall_64+0xee/0x2b0
      entry_SYSCALL_64_after_hwframe+0x42/0xb7
      
      The buggy address belongs to the page:
      page:ffffea0001998180 count:0 mapcount:0 mapping:0000000000000000 index:0x0
      flags: 0x4000000000000000()
      raw: 4000000000000000 0000000000000000 0000000000000000 00000000ffffffff
      raw: dead000000000100 dead000000000200 0000000000000000 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
      ffff880066606d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1
      ffff880066606d80: f1 00 f2 f2 f2 f2 f2 f2 f2 00 00 f2 f2 f2 f2 f2
      >ffff880066606e00: f2 00 00 00 00 00 f2 f2 f2 f3 f3 f3 f3 00 00 00
                                          ^
      ffff880066606e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      ffff880066606f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      ==================================================================
      
      Fixes: 8700e3e7 ("Soft RoCE driver")
      Signed-off-by: NBart Van Assche <bart.vanassche@wdc.com>
      Cc: Moni Shoua <monis@mellanox.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      a6544a62
    • B
      RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access · a1ae7d03
      Bart Van Assche 提交于
      This patch fixes the following KASAN complaint:
      
      ==================================================================
      BUG: KASAN: stack-out-of-bounds in rxe_post_send+0x77d/0x9b0 [rdma_rxe]
      Read of size 8 at addr ffff880061aef860 by task 01/1080
      
      CPU: 2 PID: 1080 Comm: 01 Not tainted 4.16.0-rc3-dbg+ #2
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
      Call Trace:
      dump_stack+0x85/0xc7
      print_address_description+0x65/0x270
      kasan_report+0x231/0x350
      rxe_post_send+0x77d/0x9b0 [rdma_rxe]
      __ib_drain_sq+0x1ad/0x250 [ib_core]
      ib_drain_qp+0x9/0x30 [ib_core]
      srp_destroy_qp+0x51/0x70 [ib_srp]
      srp_free_ch_ib+0xfc/0x380 [ib_srp]
      srp_create_target+0x1071/0x19e0 [ib_srp]
      kernfs_fop_write+0x180/0x210
      __vfs_write+0xb1/0x2e0
      vfs_write+0xf6/0x250
      SyS_write+0x99/0x110
      do_syscall_64+0xee/0x2b0
      entry_SYSCALL_64_after_hwframe+0x42/0xb7
      
      The buggy address belongs to the page:
      page:ffffea000186bbc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
      flags: 0x4000000000000000()
      raw: 4000000000000000 0000000000000000 0000000000000000 00000000ffffffff
      raw: 0000000000000000 ffffea000186bbe0 0000000000000000 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
      ffff880061aef700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      ffff880061aef780: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00
      >ffff880061aef800: f2 f2 f2 f2 f2 f2 f2 00 00 00 00 00 f2 f2 f2 f2
                                                            ^
      ffff880061aef880: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 f2 f2
      ffff880061aef900: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00
      ==================================================================
      
      Fixes: 765d6774 ("IB: new common API for draining queues")
      Signed-off-by: NBart Van Assche <bart.vanassche@wdc.com>
      Cc: Steve Wise <swise@opengridcomputing.com>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      a1ae7d03
    • C
      infiniband: remove redundant assignment to pointer 'rdi' · 042932f7
      Colin Ian King 提交于
      The pointer rdi is being initialized with a value that is never read
      and re-assigned immediately after, hence the initialization is redundant
      and can be removed.
      
      Cleans up clang warning:
      drivers/infiniband/sw/rdmavt/vt.c:94:23: warning: Value stored to 'rdi'
      during its initialization is never read
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      042932f7
  3. 01 3月, 2018 14 次提交
  4. 24 2月, 2018 13 次提交