From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Selvin Xavier <selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH for-4.1 10/11] RDMA/ocrdma: Prevent returning failures in the resource destroy path
Date: Fri, 15 May 2015 11:56:12 -0400 [thread overview]
Message-ID: <1431705372.29187.6.camel@redhat.com> (raw)
In-Reply-To: <1431762709-20740-11-git-send-email-selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3613 bytes --]
On Sat, 2015-05-16 at 13:21 +0530, Selvin Xavier wrote:
> Avoid returning FW failures in the resource destroy verbs.
This patch looks extremely unsafe to someone that doesn't have the
benefit of being able to look at your firmware code. What firmware
errors are you ignoring? What state is the card in whenever these
errors are returned? Is there even a remote possibility that the
firmware being in this state and returning these errors will either A)
cause erroneous attempts to write to user memory or B) interfere with
future attempts to create PDs or other contexts on the card?
> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
> Signed-off-by: Devesh Sharma <devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
> Signed-off-by: Selvin Xavier <selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
> ---
> drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 17 +++++++----------
> 1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> index 48ec56f..b1f9d7d 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
> @@ -531,13 +531,12 @@ map_err:
>
> int ocrdma_dealloc_ucontext(struct ib_ucontext *ibctx)
> {
> - int status = 0;
> struct ocrdma_mm *mm, *tmp;
> struct ocrdma_ucontext *uctx = get_ocrdma_ucontext(ibctx);
> struct ocrdma_dev *dev = get_ocrdma_dev(ibctx->device);
> struct pci_dev *pdev = dev->nic_info.pdev;
>
> - status = ocrdma_dealloc_ucontext_pd(uctx);
> + (void)ocrdma_dealloc_ucontext_pd(uctx);
>
> ocrdma_del_mmap(uctx, uctx->ah_tbl.pa, uctx->ah_tbl.len);
> dma_free_coherent(&pdev->dev, uctx->ah_tbl.len, uctx->ah_tbl.va,
> @@ -548,7 +547,7 @@ int ocrdma_dealloc_ucontext(struct ib_ucontext *ibctx)
> kfree(mm);
> }
> kfree(uctx);
> - return status;
> + return 0;
> }
>
> int ocrdma_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
> @@ -690,7 +689,6 @@ int ocrdma_dealloc_pd(struct ib_pd *ibpd)
> struct ocrdma_pd *pd = get_ocrdma_pd(ibpd);
> struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device);
> struct ocrdma_ucontext *uctx = NULL;
> - int status = 0;
> u64 usr_db;
>
> uctx = pd->uctx;
> @@ -704,11 +702,11 @@ int ocrdma_dealloc_pd(struct ib_pd *ibpd)
>
> if (is_ucontext_pd(uctx, pd)) {
> ocrdma_release_ucontext_pd(uctx);
> - return status;
> + return 0;
> }
> }
> - status = _ocrdma_dealloc_pd(dev, pd);
> - return status;
> + (void)_ocrdma_dealloc_pd(dev, pd);
> + return 0;
> }
>
> static int ocrdma_alloc_lkey(struct ocrdma_dev *dev, struct ocrdma_mr *mr,
> @@ -1905,13 +1903,12 @@ int ocrdma_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
>
> int ocrdma_destroy_srq(struct ib_srq *ibsrq)
> {
> - int status;
> struct ocrdma_srq *srq;
> struct ocrdma_dev *dev = get_ocrdma_dev(ibsrq->device);
>
> srq = get_ocrdma_srq(ibsrq);
>
> - status = ocrdma_mbx_destroy_srq(dev, srq);
> + (void)ocrdma_mbx_destroy_srq(dev, srq);
>
> if (srq->pd->uctx)
> ocrdma_del_mmap(srq->pd->uctx, (u64) srq->rq.pa,
> @@ -1920,7 +1917,7 @@ int ocrdma_destroy_srq(struct ib_srq *ibsrq)
> kfree(srq->idx_bit_fields);
> kfree(srq->rqe_wr_id_tbl);
> kfree(srq);
> - return status;
> + return 0;
> }
>
> /* unprivileged verbs and their support functions. */
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-05-15 15:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-16 7:51 [PATCH for-4.1 00/11] ocrdma bug fixes Selvin Xavier
[not found] ` <1431762709-20740-1-git-send-email-selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
2015-05-16 7:51 ` [PATCH for-4.1 01/11] RDMA/ocrdma: Fix EQ destroy failure during driver unload Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 02/11] RDMA/ocrdma: Report EQ full fatal error Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 03/11] RDMA/ocrdma: Fix QP state transition in destroy_qp Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 04/11] RDMA/ocrdma: Use VID 0 if PFC is enabled and vlan is not configured Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 05/11] RDMA/ocrdma: Fix the request length for RDMA_QUERY_QP mailbox command to FW Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 06/11] RDMA/ocrdma: Prevent allocation of DPP PDs if FW doesnt support it Selvin Xavier
[not found] ` <1431762709-20740-7-git-send-email-selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
2015-05-15 15:43 ` Doug Ledford
[not found] ` <1431704582.29187.2.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-15 16:53 ` Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 07/11] RDMA/ocrdma: Fix dmac resolution for link local address Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 08/11] RDMA/ocrdma: Fail connection for MTU lesser than 512 Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 09/11] RDMA/ocrdma: Add CQ usage statistics counters Selvin Xavier
[not found] ` <1431762709-20740-10-git-send-email-selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
2015-05-15 15:57 ` Doug Ledford
[not found] ` <1431705465.29187.8.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-15 16:55 ` Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 10/11] RDMA/ocrdma: Prevent returning failures in the resource destroy path Selvin Xavier
[not found] ` <1431762709-20740-11-git-send-email-selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org>
2015-05-15 15:56 ` Doug Ledford [this message]
[not found] ` <1431705372.29187.6.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-15 18:16 ` Selvin Xavier
2015-05-18 11:46 ` Selvin Xavier
[not found] ` <d4f35e4f79dbe5ee4e75f5cfafafcb41-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-19 18:22 ` Jason Gunthorpe
[not found] ` <20150519182232.GE18675-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-05-28 3:58 ` Selvin Xavier
2015-05-16 7:51 ` [PATCH for-4.1 11/11] RDMA/ocrdma: Update ocrdma version number Selvin Xavier
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=1431705372.29187.6.camel@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=selvin.xavier-1wcpHE2jlwO1Z/+hSey0Gg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox