Skip to content

Commit d6d142c

Browse files
SergeyGorenkorleon
authored andcommitted
IB/iser: Fix login with authentication
The iSER Initiator uses two types of receive buffers: - one big login buffer posted by iser_post_recvl(); - several small message buffers posted by iser_post_recvm(). The login buffer is used at the login phase and full feature phase in the discovery session. It may take a few requests and responses to complete the login phase. The message buffers are only used in the normal operational session at the full feature phase. After the commit referred in the fixes line, the login operation fails if the authentication is enabled. That happens because the Initiator posts a small receive buffer after the first response from Target. So, the next send operation fails because Target's second response does not fit into the small receive buffer. This commit adds additional checks to prevent posting small receive buffers until the full feature phase. Fixes: 39b169e ("IB/iser: Fix RNR errors") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sergey Gorenko <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 568035b commit d6d142c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/infiniband/ulp/iser/iser_initiator.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ void iser_login_rsp(struct ib_cq *cq, struct ib_wc *wc)
537537
struct iscsi_hdr *hdr;
538538
char *data;
539539
int length;
540+
bool full_feature_phase;
540541

541542
if (unlikely(wc->status != IB_WC_SUCCESS)) {
542543
iser_err_comp(wc, "login_rsp");
@@ -550,6 +551,9 @@ void iser_login_rsp(struct ib_cq *cq, struct ib_wc *wc)
550551
hdr = desc->rsp + sizeof(struct iser_ctrl);
551552
data = desc->rsp + ISER_HEADERS_LEN;
552553
length = wc->byte_len - ISER_HEADERS_LEN;
554+
full_feature_phase = ((hdr->flags & ISCSI_FULL_FEATURE_PHASE) ==
555+
ISCSI_FULL_FEATURE_PHASE) &&
556+
(hdr->flags & ISCSI_FLAG_CMD_FINAL);
553557

554558
iser_dbg("op 0x%x itt 0x%x dlen %d\n", hdr->opcode,
555559
hdr->itt, length);
@@ -560,7 +564,8 @@ void iser_login_rsp(struct ib_cq *cq, struct ib_wc *wc)
560564
desc->rsp_dma, ISER_RX_LOGIN_SIZE,
561565
DMA_FROM_DEVICE);
562566

563-
if (iser_conn->iscsi_conn->session->discovery_sess)
567+
if (!full_feature_phase ||
568+
iser_conn->iscsi_conn->session->discovery_sess)
564569
return;
565570

566571
/* Post the first RX buffer that is skipped in iser_post_rx_bufs() */

0 commit comments

Comments
 (0)