From fb229e1eb24ae9c9c10e6b178f48adc0785349cf Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Fri, 14 Aug 2020 00:59:56 +0900 Subject: [PATCH] lib/iscsi: Count R2T and Data Out PDUs into PDU pool size It is likely that the raw number 8 in the macro NUM_PDU_PER_CONNECTION means 2 * DEFAULT_MAXR2T and the raw number 2 means R2T and Data Out, but is not certain. On the other hand, the next patch will make the max number of outstanding R2Ts per connection configurable. As a preparation to the next patch, add 2 * DEFAULT_MAXR2T explicitly to the macro NUM_PDU_PER_CONNECTION. The next patch will replace DEFAULT_MAXR2T by an new variable. Signed-off-by: Shuhei Matsumoto Change-Id: I8a3be14d53c0abf11d7aade401386601d8fe6c11 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3783 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- lib/iscsi/iscsi_subsystem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/iscsi/iscsi_subsystem.c b/lib/iscsi/iscsi_subsystem.c index d24cbcc37..3fd381753 100644 --- a/lib/iscsi/iscsi_subsystem.c +++ b/lib/iscsi/iscsi_subsystem.c @@ -139,7 +139,9 @@ mobj_ctor(struct spdk_mempool *mp, __attribute__((unused)) void *arg, ~ISCSI_DATA_BUFFER_MASK); } -#define NUM_PDU_PER_CONNECTION(iscsi) (2 * (iscsi->MaxQueueDepth + iscsi->MaxLargeDataInPerConnection + 8)) +#define NUM_PDU_PER_CONNECTION(iscsi) (2 * (iscsi->MaxQueueDepth + \ + iscsi->MaxLargeDataInPerConnection + \ + 2 * DEFAULT_MAXR2T + 8)) #define PDU_POOL_SIZE(iscsi) (iscsi->MaxConnections * NUM_PDU_PER_CONNECTION(iscsi)) #define IMMEDIATE_DATA_POOL_SIZE(iscsi) (iscsi->MaxConnections * 128) #define DATA_OUT_POOL_SIZE(iscsi) (iscsi->MaxConnections * MAX_DATA_OUT_PER_CONNECTION)