Libiscsi: Changing header iscsi_in_pdu

socket: need to malloc hdr

include/iscsi-private: changing iscsi_in_pdu hdr to char*
		       instead of static array for more convinient iser
		       pdu creation.

To use iscsi_in_pdu in iSER without making a copy of it
we need to change hdr to pointer from static array,
Because of that, iscsi_tcp flow need to do szmalloc (small zero malloc)
hdr when creating new iscsi_in_pdu. iscsi_in_pdu is being malloced
once per each received pdu. This change is reducing iscsi_in_pdu struct
size but adding extra allocation of the same size we reduced
from the struct.

Signed-off-by: Roy Shterman <roysh@mellanox.com>
This commit is contained in:
Roy Shterman
2016-05-27 18:47:18 +03:00
committed by Ronnie Sahlberg
parent 2671e10565
commit bc64420bad
2 changed files with 3 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ struct iscsi_in_pdu {
struct iscsi_in_pdu *next;
long long hdr_pos;
unsigned char hdr[ISCSI_RAW_HEADER_SIZE + ISCSI_DIGEST_SIZE];
unsigned char *hdr;
long long data_pos;
unsigned char *data;