iscsi: Replace helper function spdk_get_data_out_buffer_size() by macro constant
The helper function spdk_get_data_out_buffer_size() is a little confusing because it does only returning macro constant SPDK_ISCSI_MAX_RECV_DATA_SEGMENT_LENGTH. The macro constant will be configurable and so the helper function is not sustainable. Replace the helper function simply by the macro constant. Change-Id: I4ec300f61783da7bb712512603c2dd80987ec702 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/c/444537 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
80fd917004
commit
97768b0773
@ -429,11 +429,11 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu)
|
||||
if (pdu->data_buf == NULL) {
|
||||
if (data_len <= spdk_get_immediate_data_buffer_size()) {
|
||||
pool = g_spdk_iscsi.pdu_immediate_data_pool;
|
||||
} else if (data_len <= spdk_get_data_out_buffer_size()) {
|
||||
} else if (data_len <= SPDK_ISCSI_MAX_RECV_DATA_SEGMENT_LENGTH) {
|
||||
pool = g_spdk_iscsi.pdu_data_out_pool;
|
||||
} else {
|
||||
SPDK_ERRLOG("Data(%d) > MaxSegment(%d)\n",
|
||||
data_len, spdk_get_data_out_buffer_size());
|
||||
data_len, SPDK_ISCSI_MAX_RECV_DATA_SEGMENT_LENGTH);
|
||||
*_pdu = NULL;
|
||||
spdk_put_pdu(pdu);
|
||||
conn->pdu_in_progress = NULL;
|
||||
@ -513,7 +513,7 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu)
|
||||
*/
|
||||
max_segment_len = SPDK_ISCSI_FIRST_BURST_LENGTH;
|
||||
} else if (pdu->bhs.opcode == ISCSI_OP_SCSI_DATAOUT) {
|
||||
max_segment_len = spdk_get_data_out_buffer_size();
|
||||
max_segment_len = SPDK_ISCSI_MAX_RECV_DATA_SEGMENT_LENGTH;
|
||||
} else if (pdu->bhs.opcode == ISCSI_OP_NOPOUT) {
|
||||
max_segment_len = SPDK_ISCSI_MAX_RECV_DATA_SEGMENT_LENGTH;
|
||||
} else {
|
||||
|
@ -461,10 +461,4 @@ spdk_get_immediate_data_buffer_size(void)
|
||||
52; /* extended CDB AHS (for a 64-byte CDB) */
|
||||
}
|
||||
|
||||
static inline int
|
||||
spdk_get_data_out_buffer_size(void)
|
||||
{
|
||||
return SPDK_ISCSI_MAX_RECV_DATA_SEGMENT_LENGTH;
|
||||
}
|
||||
|
||||
#endif /* SPDK_ISCSI_H */
|
||||
|
@ -147,7 +147,7 @@ static int spdk_iscsi_initialize_pdu_pool(void)
|
||||
struct spdk_iscsi_globals *iscsi = &g_spdk_iscsi;
|
||||
int imm_mobj_size = spdk_get_immediate_data_buffer_size() +
|
||||
sizeof(struct spdk_mobj) + ISCSI_DATA_BUFFER_ALIGNMENT;
|
||||
int dout_mobj_size = spdk_get_data_out_buffer_size() +
|
||||
int dout_mobj_size = SPDK_ISCSI_MAX_RECV_DATA_SEGMENT_LENGTH +
|
||||
sizeof(struct spdk_mobj) + ISCSI_DATA_BUFFER_ALIGNMENT;
|
||||
|
||||
/* create PDU pool */
|
||||
|
Loading…
Reference in New Issue
Block a user