public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
	Tziporet Koren <tziporet-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V2 1/4] ib_core: changes to support XRC RCV qp's
Date: Wed, 19 May 2010 09:30:33 +0300	[thread overview]
Message-ID: <201005190930.33947.jackm@dev.mellanox.co.il> (raw)
In-Reply-To: <21985B556C0D42658109996B406ADC15-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>

On Tuesday 18 May 2010 21:33, Sean Hefty wrote:
> >+struct ib_xrc_rcv_qp_table_entry *
> >+ib_xrc_rcv_tbl_find(struct ib_device *dev, u32 qpn)
> >+{
> >+        return radix_tree_lookup(&dev->xrc_rcv_qp_table, qpn);
> >+}
> 
> nit - but do we need a wrapper around this single call?
I prefer it this way, so that we have a complete xrc_rcv_table interface.
 
> >+	list_for_each_entry(tmp, &qp->list, list)
> >+		if (tmp->context == context) {
> >+			found = 1;
> >+			break;
> >+		}
> >+	/* add only a single entry per user context */
> >+	if (unlikely(found)) {
> >+		err = 0;
> >+		goto free_out;
> >+	}
> 
> Maybe this becomes clear later, but can a user add multiple entries?  Can't we
> just consider this a usage error?  Actually, why does it matter if the same
> context is added multiple times?

This list of entries is also used to disperse XRC RCV qp events to all registered
processes -- and we only want a single event dispatched per process.

> >+	dev->destroy_xrc_rcv_qp(qp->xrcd, qpn);
> >+	kfree(qp);
> >+	list_for_each_entry_safe(reg_entry, tmp, &xrc_local, list) {
> >+		list_del(&reg_entry->list);
> >+		kfree(reg_entry);
> >+		atomic_dec(&qp->xrcd->usecnt);
> 
> qp was just freed a few lines up
Ouch!  Thanks for the catch, Sean.  I'll fix it before resubmitting.


Regards,
Jack
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2010-05-19  6:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18 11:55 [PATCH V2 1/4] ib_core: changes to support XRC RCV qp's Jack Morgenstein
     [not found] ` <201005181455.02623.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2010-05-18 18:33   ` Sean Hefty
     [not found]     ` <21985B556C0D42658109996B406ADC15-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2010-05-19  6:30       ` Jack Morgenstein [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=201005190930.33947.jackm@dev.mellanox.co.il \
    --to=jackm-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=tziporet-VPRAkNaXOzVS1MOuV/RT9w@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