[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140317133255.GA22637@mtldesk30>
Date: Mon, 17 Mar 2014 15:32:55 +0200
From: Eli Cohen <eli@....mellanox.co.il>
To: clsoto@...ux.vnet.ibm.com
Cc: eli@...lanox.com, roland@...nel.org, sean.hefty@...el.com,
hal.rosenstock@...il.com, linux-rdma@...r.kernel.org,
netdev@...r.kernel.org, brking@...ux.vnet.ibm.com
Subject: Re: [PATCH v2 2/2] IB/mlx5: Free resources during PCI error
On Fri, Mar 14, 2014 at 12:14:58PM -0500, clsoto@...ux.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;
> }
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists