* [PATCH] IB/iser: Fix login with authentication
@ 2022-08-05 6:01 Sergey Gorenko
2022-08-16 12:57 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Sergey Gorenko @ 2022-08-05 6:01 UTC (permalink / raw)
To: Sagi Grimberg; +Cc: linux-rdma, Sergey Gorenko, Max Gurtovoy
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: 39b169ea0d36 ("IB/iser: Fix RNR errors")
Signed-off-by: Sergey Gorenko <sergeygo@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
drivers/infiniband/ulp/iser/iser_initiator.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index bd5f3b5e1727..7b83f48f60c5 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -537,6 +537,7 @@ void iser_login_rsp(struct ib_cq *cq, struct ib_wc *wc)
struct iscsi_hdr *hdr;
char *data;
int length;
+ bool full_feature_phase;
if (unlikely(wc->status != IB_WC_SUCCESS)) {
iser_err_comp(wc, "login_rsp");
@@ -550,6 +551,9 @@ void iser_login_rsp(struct ib_cq *cq, struct ib_wc *wc)
hdr = desc->rsp + sizeof(struct iser_ctrl);
data = desc->rsp + ISER_HEADERS_LEN;
length = wc->byte_len - ISER_HEADERS_LEN;
+ full_feature_phase = ((hdr->flags & ISCSI_FULL_FEATURE_PHASE) ==
+ ISCSI_FULL_FEATURE_PHASE) &&
+ (hdr->flags & ISCSI_FLAG_CMD_FINAL);
iser_dbg("op 0x%x itt 0x%x dlen %d\n", hdr->opcode,
hdr->itt, length);
@@ -560,7 +564,8 @@ void iser_login_rsp(struct ib_cq *cq, struct ib_wc *wc)
desc->rsp_dma, ISER_RX_LOGIN_SIZE,
DMA_FROM_DEVICE);
- if (iser_conn->iscsi_conn->session->discovery_sess)
+ if (!full_feature_phase ||
+ iser_conn->iscsi_conn->session->discovery_sess)
return;
/* Post the first RX buffer that is skipped in iser_post_rx_bufs() */
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] IB/iser: Fix login with authentication
2022-08-05 6:01 [PATCH] IB/iser: Fix login with authentication Sergey Gorenko
@ 2022-08-16 12:57 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2022-08-16 12:57 UTC (permalink / raw)
To: Sergey Gorenko; +Cc: Sagi Grimberg, linux-rdma, Max Gurtovoy
On Fri, Aug 05, 2022 at 09:01:35AM +0300, Sergey Gorenko wrote:
> 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: 39b169ea0d36 ("IB/iser: Fix RNR errors")
> Signed-off-by: Sergey Gorenko <sergeygo@nvidia.com>
> Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> ---
> drivers/infiniband/ulp/iser/iser_initiator.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
Thanks, applied to -rc.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-16 12:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-05 6:01 [PATCH] IB/iser: Fix login with authentication Sergey Gorenko
2022-08-16 12:57 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox