From: Marciniszyn, Mike [[email protected]]
Sent: Thursday, July 12, 2012 7:48 PM
To: Or Gerlitz; [email protected]
Cc: [email protected]; [email protected]; 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to