Commit 570db170 authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Nicholas Bellinger

iser-target: Allocate PI contexts dynamically

This patch converts to allocate PI contexts dynamically in order
avoid a potentially bogus np->tpg_np and associated NULL pointer
dereference in isert_connect_request() during iser-target endpoint
shutdown with multiple network portals.

Also, there is really no need to allocate these at connection
establishment since it is not guaranteed that all the IOs on
that connection will be to a PI formatted device.

We can do it in a lazy fashion so the initial burst will have a
transient slow down, but very fast all IOs will allocate a PI
context.

Squashed:

iser-target: Centralize PI context handling code
Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
Cc: <stable@vger.kernel.org> # v3.14+
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent b02efbfc
This diff is collapsed.
...@@ -82,6 +82,12 @@ struct isert_data_buf { ...@@ -82,6 +82,12 @@ struct isert_data_buf {
enum dma_data_direction dma_dir; enum dma_data_direction dma_dir;
}; };
enum {
DATA = 0,
PROT = 1,
SIG = 2,
};
struct isert_rdma_wr { struct isert_rdma_wr {
struct list_head wr_list; struct list_head wr_list;
struct isert_cmd *isert_cmd; struct isert_cmd *isert_cmd;
...@@ -91,6 +97,7 @@ struct isert_rdma_wr { ...@@ -91,6 +97,7 @@ struct isert_rdma_wr {
int send_wr_num; int send_wr_num;
struct ib_send_wr *send_wr; struct ib_send_wr *send_wr;
struct ib_send_wr s_send_wr; struct ib_send_wr s_send_wr;
struct ib_sge ib_sg[3];
struct isert_data_buf data; struct isert_data_buf data;
struct isert_data_buf prot; struct isert_data_buf prot;
struct fast_reg_descriptor *fr_desc; struct fast_reg_descriptor *fr_desc;
......
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