netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eli Cohen <eli@dev.mellanox.co.il>
To: clsoto@linux.vnet.ibm.com
Cc: eli@mellanox.com, roland@kernel.org, sean.hefty@intel.com,
	hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org,
	netdev@vger.kernel.org, brking@linux.vnet.ibm.com
Subject: Re: [PATCH v2 2/2] IB/mlx5: Free resources during PCI error
Date: Mon, 17 Mar 2014 15:32:55 +0200	[thread overview]
Message-ID: <20140317133255.GA22637@mtldesk30> (raw)
In-Reply-To: <20140314171659.686646150@linux.vnet.ibm.com>

On Fri, Mar 14, 2014 at 12:14:58PM -0500, clsoto@linux.vnet.ibm.com wrote:

Hi Carol, see my comments below.
Also, can please share with us if you've been making any testing to
these patches, how you tested and what were the results?
 
> @@ -471,9 +471,12 @@ static void clean_keys(struct mlx5_ib_de
>  		ent->size--;
>  		spin_unlock_irq(&ent->lock);
>  		err = mlx5_core_destroy_mkey(&dev->mdev, &mr->mmr);
> -		if (err)
> -			mlx5_ib_warn(dev, "failed destroy mkey\n");
> -		else
> +		if (err) {
> +			if (pci_channel_offline(dev->mdev.pdev))
> +				kfree(mr);

Why not just check if -EIO returned.

> +			else
> +				mlx5_ib_warn(dev, "failed destroy mkey\n");
> +		} else
>  			kfree(mr);
>  	}
>  }
> Index: b/drivers/infiniband/hw/mlx5/qp.c
> ===================================================================
> --- a/drivers/infiniband/hw/mlx5/qp.c
> +++ b/drivers/infiniband/hw/mlx5/qp.c
> @@ -2564,7 +2564,11 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd 
>  
>  	err = mlx5_core_xrcd_dealloc(&dev->mdev, xrcdn);
>  	if (err) {
> -		mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n", xrcdn);
> +		if (pci_channel_offline(dev->mdev.pdev))
> +			kfree(xrcd);
> +		else
> +			mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n",
> +				     xrcdn);
You chose to give special treatment to this command, why is that?
>  		return err;
>  	}
>  

      reply	other threads:[~2014-03-17 13:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 17:14 [PATCH v2 0/2] IB/mlx5: Add PCI error handler support for mlx5 clsoto-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
2014-03-14 17:14 ` [PATCH v2 1/2] IB/mlx5: Implementation of PCI error handler clsoto
2014-03-14 17:14 ` [PATCH v2 2/2] IB/mlx5: Free resources during PCI error clsoto
2014-03-17 13:32   ` Eli Cohen [this message]

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=20140317133255.GA22637@mtldesk30 \
    --to=eli@dev.mellanox.co.il \
    --cc=brking@linux.vnet.ibm.com \
    --cc=clsoto@linux.vnet.ibm.com \
    --cc=eli@mellanox.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roland@kernel.org \
    --cc=sean.hefty@intel.com \
    /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).