All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Bart Van Assche <Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org>
Cc: "dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
	<jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
	<monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] RDMA/rxe: Fix a race condition related to the QP error state
Date: Thu, 11 Jan 2018 21:00:45 +0200	[thread overview]
Message-ID: <20180111190045.GE15760@mtr-leonro.local> (raw)
In-Reply-To: <1515686552.2752.2.camel-Sjgp3cTcYWE@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 922 bytes --]

On Thu, Jan 11, 2018 at 04:02:33PM +0000, Bart Van Assche wrote:
> On Thu, 2018-01-11 at 08:22 +0200, Leon Romanovsky wrote:
> > The proposed patch definitely decreases the chance of races, but it is not fixing them.
> > There is a chance to have change in qp state immediately after your "if ..." check.
>
> Hello Leon,
>
> Please have a look at rxe_qp_error() and you will see that the patch I posted
> is a proper fix. In the scenario you described rxe_qp_error() will trigger a
> run of rxe_completer().

Bart,

What am I missing?

CPU1							CPU2
							if (unlikely....
						<---
/* move the qp to the error state */
void rxe_qp_error(struct rxe_qp *qp)
{
        qp->req.state = QP_STATE_ERROR;
        qp->resp.state = QP_STATE_ERROR;
        qp->attr.qp_state = IB_QPS_ERR;
						--->
							rxe_run_task(&qp->req.task, must_sched);



It is more or less the same as without "if (unlikely..."

Thanks

>
> Bart.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon@kernel.org>
To: Bart Van Assche <Bart.VanAssche@wdc.com>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"jgg@mellanox.com" <jgg@mellanox.com>,
	"monis@mellanox.com" <monis@mellanox.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] RDMA/rxe: Fix a race condition related to the QP error state
Date: Thu, 11 Jan 2018 21:00:45 +0200	[thread overview]
Message-ID: <20180111190045.GE15760@mtr-leonro.local> (raw)
In-Reply-To: <1515686552.2752.2.camel@wdc.com>

[-- Attachment #1: Type: text/plain, Size: 922 bytes --]

On Thu, Jan 11, 2018 at 04:02:33PM +0000, Bart Van Assche wrote:
> On Thu, 2018-01-11 at 08:22 +0200, Leon Romanovsky wrote:
> > The proposed patch definitely decreases the chance of races, but it is not fixing them.
> > There is a chance to have change in qp state immediately after your "if ..." check.
>
> Hello Leon,
>
> Please have a look at rxe_qp_error() and you will see that the patch I posted
> is a proper fix. In the scenario you described rxe_qp_error() will trigger a
> run of rxe_completer().

Bart,

What am I missing?

CPU1							CPU2
							if (unlikely....
						<---
/* move the qp to the error state */
void rxe_qp_error(struct rxe_qp *qp)
{
        qp->req.state = QP_STATE_ERROR;
        qp->resp.state = QP_STATE_ERROR;
        qp->attr.qp_state = IB_QPS_ERR;
						--->
							rxe_run_task(&qp->req.task, must_sched);



It is more or less the same as without "if (unlikely..."

Thanks

>
> Bart.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2018-01-11 19:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 19:23 [PATCH] RDMA/rxe: Fix a race condition related to the QP error state Bart Van Assche
2018-01-10 21:40 ` Doug Ledford
2018-01-10 22:01   ` Doug Ledford
2018-01-11  6:22     ` Leon Romanovsky
     [not found]       ` <20180111062252.GP7368-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-11 16:02         ` Bart Van Assche
2018-01-11 16:02           ` Bart Van Assche
     [not found]           ` <1515686552.2752.2.camel-Sjgp3cTcYWE@public.gmane.org>
2018-01-11 19:00             ` Leon Romanovsky [this message]
2018-01-11 19:00               ` Leon Romanovsky
2018-01-11 19:07               ` Bart Van Assche
2018-01-12  6:23                 ` Leon Romanovsky
     [not found]                   ` <20180112062359.GG15760-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-01-12  6:32                     ` Bart Van Assche
2018-01-12  6:32                       ` Bart Van Assche
2018-01-12  6:38                       ` Leon Romanovsky
2018-01-11 11:27 ` Moni Shoua
2018-01-11 16:16   ` Bart Van Assche

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=20180111190045.GE15760@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.