All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shlomo Pongratz <shlomop-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: "Marciniszyn,
	Mike" <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org"
	<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: RE: [PATCH] IB/ipoib: break linkage to neighbouring system
Date: Thu, 12 Jul 2012 20:13:28 +0000	[thread overview]
Message-ID: <36F7E4A28C18BE4DB7C86058E7B607241DC0E3A6@MTLDAG01.mtl.com> (raw)
In-Reply-To: <32E1700B9017364D9B60AED9960492BC0D47265A-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>

From: Marciniszyn, Mike [mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org]
Sent: Thursday, July 12, 2012 7:48 PM
To: Or Gerlitz; roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org; Erez Shitrit; Shlomo Pongratz
Subject: RE: [PATCH] IB/ipoib: break linkage to neighbouring system

ipoib_path_lookup(skb, n, dev);
> +struct ipoib_neigh *ipoib_neigh_get(struct net_device *dev, u8 *daddr)
>  {
> +     struct ipoib_dev_priv *priv = netdev_priv(dev);
> +     struct ipoib_hash_table *htbl = &priv->neigh_htbl;
>       struct ipoib_neigh *neigh;
> -     struct ipoib_dev_priv *priv = netdev_priv(n->dev);
> +
> +     read_lock_bh(&htbl->rwlock);
> +     neigh = ipoib_neigh_lookup(htbl, daddr);
> +     read_unlock_bh(&htbl->rwlock);
> +
> +     return neigh;
> +}
> +
I'm surprised a bit to see a reader lock when the routine being called used RCU with a reference count...

The RCU and reference count protect the individual entries in the hash.
The R/W lock protects the hash table itself. e.g. deleting the hash table itself, or in the future re-sizing it.
S.P.--
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:[~2012-07-12 20:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10 10:01 [PATCH] IB/ipoib: break linkage to neighbouring system Or Gerlitz
     [not found] ` <1341914495-32730-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-07-12 13:52   ` Or Gerlitz
2012-07-12 16:48   ` Marciniszyn, Mike
     [not found]     ` <32E1700B9017364D9B60AED9960492BC0D47265A-AtyAts71sc88Ug9VwtkbtrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-07-12 20:13       ` Shlomo Pongratz [this message]
     [not found]         ` <36F7E4A28C18BE4DB7C86058E7B607241DC0E3A6-fViJhHBwANKuSA5JZHE7gA@public.gmane.org>
2012-07-12 20:24           ` Marciniszyn, Mike
2012-07-13  0:58           ` David Miller
     [not found]             ` <20120712.175825.1973614213454644336.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-07-13 11:04               ` Or Gerlitz
2012-07-15 10:17               ` Or Gerlitz

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=36F7E4A28C18BE4DB7C86058E7B607241DC0E3A6@MTLDAG01.mtl.com \
    --to=shlomop-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.