linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shai Malin <smalin@marvell.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"jgg@ziepe.ca" <jgg@ziepe.ca>, Ariel Elior <aelior@marvell.com>,
	"malin1024@gmail.com" <malin1024@gmail.com>,
	Michal Kalderon <mkalderon@marvell.com>
Subject: RE: [PATCH net v2] qed: rdma - don't wait for resources under hw error recovery flow
Date: Wed, 22 Sep 2021 10:55:21 +0000	[thread overview]
Message-ID: <SJ0PR18MB3882BCB095875CF5B09DC88CCCA29@SJ0PR18MB3882.namprd18.prod.outlook.com> (raw)

On Wed, 22 Sept 2021 at 12:40, Leon Romanovsky <leon@kernel.org> wrote:
> On Wed, Sep 22, 2021 at 10:36:31AM +0300, Shai Malin wrote:
> > If the HW device is during recovery, the HW resources will never return,
> > hence we shouldn't wait for the CID (HW context ID) bitmaps to clear.
> > This fix speeds up the error recovery flow.
> >
> > Changes since v1:
> > - Fix race condition (thanks to Leon Romanovsky).
> 
> Please put changelog under "---", there is a little value for them in the
> commit message.

Sure. Thanks.

> 
> >
> > Fixes: 64515dc899df ("qed: Add infrastructure for error detection and
> recovery")
> > Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
> > Signed-off-by: Ariel Elior <aelior@marvell.com>
> > Signed-off-by: Shai Malin <smalin@marvell.com>
> > ---
> >  drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 8 ++++++++
> >  drivers/net/ethernet/qlogic/qed/qed_roce.c  | 8 ++++++++
> >  2 files changed, 16 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> > index fc8b3e64f153..186d0048a9d1 100644
> > --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> > +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> > @@ -1297,6 +1297,14 @@ qed_iwarp_wait_cid_map_cleared(struct qed_hwfn
> *p_hwfn, struct qed_bmap *bmap)
> >  	prev_weight = weight;
> >
> >  	while (weight) {
> > +		/* If the HW device is during recovery, all resources are
> > +		 * immediately reset without receiving a per-cid indication
> > +		 * from HW. In this case we don't expect the cid_map to be
> > +		 * cleared.
> > +		 */
> > +		if (p_hwfn->cdev->recov_in_prog)
> > +			return 0;
> > +
> >  		msleep(QED_IWARP_MAX_CID_CLEAN_TIME);
> >
> >  		weight = bitmap_weight(bmap->bitmap, bmap->max_count);
> > diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c
> b/drivers/net/ethernet/qlogic/qed/qed_roce.c
> > index f16a157bb95a..cf5baa5e59bc 100644
> > --- a/drivers/net/ethernet/qlogic/qed/qed_roce.c
> > +++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c
> > @@ -77,6 +77,14 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn)
> >  	 * Beyond the added delay we clear the bitmap anyway.
> >  	 */
> >  	while (bitmap_weight(rcid_map->bitmap, rcid_map->max_count)) {
> > +		/* If the HW device is during recovery, all resources are
> > +		 * immediately reset without receiving a per-cid indication
> > +		 * from HW. In this case we don't expect the cid bitmap to be
> > +		 * cleared.
> > +		 */
> > +		if (p_hwfn->cdev->recov_in_prog)
> > +			return;
> > +
> >  		msleep(100);
> >  		if (wait_count++ > 20) {
> >  			DP_NOTICE(p_hwfn, "cid bitmap wait timed out\n");
> > --
> > 2.27.0
> >

             reply	other threads:[~2021-09-22 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 10:55 Shai Malin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-09-22  7:36 [PATCH net v2] qed: rdma - don't wait for resources under hw error recovery flow Shai Malin
2021-09-22  9:40 ` Leon Romanovsky

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=SJ0PR18MB3882BCB095875CF5B09DC88CCCA29@SJ0PR18MB3882.namprd18.prod.outlook.com \
    --to=smalin@marvell.com \
    --cc=aelior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=jgg@ziepe.ca \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=malin1024@gmail.com \
    --cc=mkalderon@marvell.com \
    --cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).