Commit bb087aec authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Luis Henriques

IB/srp: Fix possible send queue overflow

commit 09c0c0be upstream.

When using work request based memory registration (fast_reg)
we must reserve SQ entries for registration and invalidation
in addition to send operations. Each IO consumes 3 SQ entries
(registration, send, invalidation) so we need to allocate 3x
larger send-queue instead of 2x.
Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
[ luis: backported to 3.16:
  - change function srp_create_target_ib() instead of srp_create_ch_ib()
  - adjusted context ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent ea312c49
......@@ -451,7 +451,7 @@ static int srp_create_target_ib(struct srp_target_port *target)
struct ib_qp *qp;
struct ib_fmr_pool *fmr_pool = NULL;
struct srp_fr_pool *fr_pool = NULL;
const int m = 1 + dev->use_fast_reg;
const int m = dev->use_fast_reg ? 3 : 1;
int ret;
init_attr = kzalloc(sizeof *init_attr, GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment