Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIW sends RTR WRITE even though RTR READ was negotiated #20

Open
gregjoyce opened this issue Aug 10, 2017 · 4 comments
Open

SIW sends RTR WRITE even though RTR READ was negotiated #20

gregjoyce opened this issue Aug 10, 2017 · 4 comments

Comments

@gregjoyce
Copy link

siw is the initiator (1.1.1.2)

16:39:36.550313 1.1.1.2.55097 > 1.1.1.1.3333: P 1:25(24) ack 1 win 229 [mpa: start-req C pdlen 4 mpav2: enhanced - ird 1 ord 2 peer2peer write RTR read RTR] (DF)
16:39:36.550801 1.1.1.1.3333 > 1.1.1.2.55097: P 1:25(24) ack 25 win 32768 [mpa: start-rep C pdlen 4 mpav2: enhanced - ird 2 ord 1 peer2peer read RTR] (DF)
16:39:36.550858 1.1.1.2.55097 > 1.1.1.1.3333: P 25:45(20) ack 25 win 229 [mpa: ulplen 14 ddp: v1 TL stag 0 to 0 rdmap: WRITE ] (DF)
16:39:36.551106 1.1.1.1.3333 > 1.1.1.2.55097: P 25:53(28) ack 45 win 32768 [mpa: ulplen 22 ddp: v1 UL inv_stag 0 qn 2 msn 1 mo 0 rdmap: TERM layertype 00 ecode 00 hdrct 00 ] (DF)

@gregjoyce
Copy link
Author

gregjoyce commented Aug 23, 2017


@@ -964,7 +969,7 @@ static int siw_proc_mpareply(struct siw_cep *cep)
                }

                if (cep->mpa.v2_ctrl_req.ird & MPA_V2_PEER_TO_PEER)
-                       mpa_p2p_mode = cep->mpa.v2_ctrl_req.ord &
+                       mpa_p2p_mode = v2->ord &
                                (MPA_V2_RDMA_WRITE_RTR | MPA_V2_RDMA_READ_RTR);

@gregjoyce
Copy link
Author

When determining the RTR type to send look at the negotiated ord, not the requested one.

@larrystevenwise
Copy link
Contributor

larrystevenwise commented Aug 24, 2017

This fix seems correct.

@BernardMetzler
Copy link
Member

good catch, thanks! but we have to check first if we proposed anything. if there is no intersection we refuse....:

                        mpa_p2p_mode = cep->mpa.v2_ctrl_req.ord &
                                (MPA_V2_RDMA_WRITE_RTR | MPA_V2_RDMA_READ_RTR);

                /*
                 * Check if we requested P2P mode, and if peer agrees
                 */
                if (mpa_p2p_mode != MPA_V2_RDMA_NO_RTR) {
                        if ((mpa_p2p_mode & v2->ord) == 0) {
                                /*
                                 * We requested RTR mode(s), but the peer
                                 * did not pick any mode we support.
                                 */
                                dprint(DBG_ON,
                                        " RTR mode:  Req %2x, Got %2x\n",
                                        mpa_p2p_mode,
                                        v2->ord & (MPA_V2_RDMA_WRITE_RTR |
                                                   MPA_V2_RDMA_READ_RTR));

                                siw_send_terminate(qp, RDMAP_ERROR_LAYER_LLP,
                                                   LLP_ETYPE_MPA,
                                                   LLP_ECODE_NO_MATCHING_RTR);
                                rv = -EPROTO;
                                goto out_err;
                        }
                        mpa_p2p_mode = v2->ord &
                                (MPA_V2_RDMA_WRITE_RTR | MPA_V2_RDMA_READ_RTR);
                }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants