From: David Miller <davem@davemloft.net>
To: hadarh@mellanox.com
Cc: netdev@vger.kernel.org, ogerlitz@mellanox.com, idosch@mellanox.com
Subject: Re: using rcu_read_lock() after calling dst_neigh_lookup
Date: Tue, 10 Jan 2017 12:02:13 -0500 (EST) [thread overview]
Message-ID: <20170110.120213.1297610016130641176.davem@davemloft.net> (raw)
In-Reply-To: <ead29087-05cc-c586-3b7e-d37c2e6f753c@mellanox.com>
From: Hadar Hen Zion <hadarh@mellanox.com>
Date: Tue, 10 Jan 2017 16:22:51 +0200
> While the documentation in neighbour.c says:
>
> "Neighbour entries are protected:
> - with reference count.
> - with rwlock neigh->lock
> Reference count prevents destruction.
> neigh->lock mainly serializes ll address data and its validity state."
>
> So what is the right way to protect the neigh entry parameters? I
> couldn't find why rcu_read_lock() is helping here (dst_neigh_lookup
> already takes a reference on the neigh).
Documentation is, unfortunately, out of date.
When there is a mis-match, usually the behavior of the code in the
tree trumps whatever the documentation says.
prev parent reply other threads:[~2017-01-10 17:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-10 14:22 using rcu_read_lock() after calling dst_neigh_lookup Hadar Hen Zion
2017-01-10 17:02 ` David Miller [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=20170110.120213.1297610016130641176.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=hadarh@mellanox.com \
--cc=idosch@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
/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