IB/srpt: Change default behavior from using SRQ to using RC
authorBart Van Assche <bart.vanassche@wdc.com>
Wed, 11 Oct 2017 17:27:25 +0000 (10:27 -0700)
committerDoug Ledford <dledford@redhat.com>
Wed, 18 Oct 2017 14:49:54 +0000 (10:49 -0400)
commitdea262094cdf629a3380061722b205de04057799
treee22178edb4c32a45bb1e80b00fe6948014a8d597
parent74333f122388437cf1e2296ee9a3ae19d8858bc4
IB/srpt: Change default behavior from using SRQ to using RC

Although in the RC mode more resources are needed that mode has three
advantages over SRQ:
- It works with all RDMA adapters, even those that do not support
  SRQ.
- Posting WRs and polling WCs does not trigger lock contention
  because only one thread at a time accesses a WR or WC queue in
  non-SRQ mode.
- The end-to-end flow control mechanism is used.

>From the IB spec:

    C9-150.2.1: For QPs that are not associated with an SRQ, each HCA
    receive queue shall generate end-to-end flow control credits. If
    a QP is associated with an SRQ, the HCA receive queue shall not
    generate end-to-end flow control credits.

Add new configfs attributes that allow to configure which mode to use
(/sys/kernel/config/target/srpt/$GUID/$GUID/attrib/use_srq). Note:
only the attribute for port 1 is relevant on multi-port adapters.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/infiniband/ulp/srpt/ib_srpt.h