All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Doug Ledford <dledford@redhat.com>, linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-rc] RDMA/cm: Fix missing RDMA_CM_EVENT_REJECTED event after receiving REJ message
Date: Mon, 6 Apr 2020 21:38:45 +0300	[thread overview]
Message-ID: <20200406183845.GK80989@unreal> (raw)
In-Reply-To: <20200406174556.GS20941@ziepe.ca>

On Mon, Apr 06, 2020 at 02:45:56PM -0300, Jason Gunthorpe wrote:
> On Mon, Apr 06, 2020 at 08:32:42PM +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > The cm_reset_to_idle() call before formatting event changed the CM_ID
> > state from IB_CM_REQ_RCVD to be IB_CM_IDLE. It caused to wrong value
> > of CM_REJ_MESSAGE_REJECTED field.
> >
> > The result of that was that rdma_reject() calls in the passive side
> > didn't generate RDMA_CM_EVENT_REJECTED event in the active side.
> >
> > Fixes: 81ddb41f876d ("RDMA/cm: Allow ib_send_cm_rej() to be done under lock")
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> >  drivers/infiniband/core/cm.c | 24 +++++++++++++-----------
> >  1 file changed, 13 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
> > index bbbfa77dbce7..06f8eeba423a 100644
> > +++ b/drivers/infiniband/core/cm.c
> > @@ -1843,11 +1843,9 @@ static void cm_format_mra(struct cm_mra_msg *mra_msg,
> >
> >  static void cm_format_rej(struct cm_rej_msg *rej_msg,
> >  			  struct cm_id_private *cm_id_priv,
> > -			  enum ib_cm_rej_reason reason,
> > -			  void *ari,
> > -			  u8 ari_length,
> > -			  const void *private_data,
> > -			  u8 private_data_len)
> > +			  enum ib_cm_rej_reason reason, void *ari,
> > +			  u8 ari_length, const void *private_data,
> > +			  u8 private_data_len, enum ib_cm_state state)
> >  {
> >  	lockdep_assert_held(&cm_id_priv->lock);
> >
> > @@ -1855,7 +1853,7 @@ static void cm_format_rej(struct cm_rej_msg *rej_msg,
> >  	IBA_SET(CM_REJ_REMOTE_COMM_ID, rej_msg,
> >  		be32_to_cpu(cm_id_priv->id.remote_id));
> >
> > -	switch(cm_id_priv->id.state) {
> > +	switch (state) {
> >  	case IB_CM_REQ_RCVD:
> >  		IBA_SET(CM_REJ_LOCAL_COMM_ID, rej_msg, be32_to_cpu(0));
> >  		IBA_SET(CM_REJ_MESSAGE_REJECTED, rej_msg, CM_MSG_RESPONSE_REQ);
> > @@ -1920,8 +1918,9 @@ static void cm_dup_req_handler(struct cm_work *work,
> >  			      cm_id_priv->private_data_len);
> >  		break;
> >  	case IB_CM_TIMEWAIT:
> > -		cm_format_rej((struct cm_rej_msg *) msg->mad, cm_id_priv,
> > -			      IB_CM_REJ_STALE_CONN, NULL, 0, NULL, 0);
> > +		cm_format_rej((struct cm_rej_msg *)msg->mad, cm_id_priv,
> > +			      IB_CM_REJ_STALE_CONN, NULL, 0, NULL, 0,
> > +			      cm_id_priv->id.state);
>
> This can just be IB_CM_TIMEWAIT instead of cm_id_priv->id.state

It can, do you want me to resend it? Or maybe you can change it while
applying?

Thanks

>
> Jason

  reply	other threads:[~2020-04-06 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 17:32 [PATCH rdma-rc] RDMA/cm: Fix missing RDMA_CM_EVENT_REJECTED event after receiving REJ message Leon Romanovsky
2020-04-06 17:45 ` Jason Gunthorpe
2020-04-06 18:38   ` Leon Romanovsky [this message]
2020-04-14 18:51 ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200406183845.GK80989@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.