Commit 8f3fa385 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

lib/iscsi: Add a flag to struct spdk_iscsi_pdu to know if it is rejected



The subsequent patches will separate PDU header handling and PDU
payload handling. But for the PDUs which have data segment,
if PDU header is correct, we have to read data segment even if any other
error is found and the PDU is rejected.

To do that, add a flag is_rejected to pass if the PDU is rejected or
not from PDU header handling to PDU payload handling.

If PDU payload handling sees the PDU is already relected, do nothing.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie3fe518fc0f452da9965a2fe3642568c86866480
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471005


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 6fa12139
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -250,6 +250,8 @@ iscsi_reject(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu,
	int data_len;
	int alloc_len;

	pdu->is_rejected = true;

	total_ahs_len = pdu->bhs.total_ahs_len;
	data_len = 0;
	alloc_len = ISCSI_BHS_LEN + (4 * total_ahs_len);
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ struct spdk_mobj {
struct spdk_iscsi_pdu {
	struct iscsi_bhs bhs;
	struct spdk_mobj *mobj;
	bool is_rejected;
	uint8_t *data_buf;
	uint8_t *data;
	uint8_t header_digest[ISCSI_DIGEST_LEN];