All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Eli Cohen <eli@dev.mellanox.co.il>
Cc: netdev <netdev@vger.kernel.org>,
	fubar@us.ibm.com, ogerlitz@voltaire.com,
	Roland Dreier <rdreier@cisco.com>,
	general-list <general@lists.openfabrics.org>
Subject: Re: locking requirements when calling dev_set_mtu()
Date: Wed, 2 Jul 2008 09:41:40 -0700	[thread overview]
Message-ID: <20080702094140.032efd28@extreme> (raw)
In-Reply-To: <20080702085409.GA13098@mtls03>

On Wed, 2 Jul 2008 11:54:09 +0300
Eli Cohen <eli@dev.mellanox.co.il> wrote:

> Hi,
> 
> I have the need to change the MTU of IP over IB from the driver code
> and not from the shell. Looking for the right way to do it I came
> across the dev_set_mtu() which seems appropriate as it handles all
> notifications too. However, it is not clear to me whether I have to
> wrap the call to dev_set_mtu() with any locks. Specifically, I was
> referred to a mail thread that suggests that I have to use
> rtnl_lock()/rtnl_unlock():
> http://marc.info/?l=linux-netdev&m=121201324611292&w=2
> 
> With reference to the above URL, I would say that it is possible for
> me to hit to the assertion ASSERT_RTNL() if I don't take rtnl_lock
> prior to calling dev_set_mtu(). However I don't hit it, though I can't
> count on that there will not be a case that any function registered
> for notification would expect to see the lock acquired.
> 

You need to call rtnl_lock() so device drivers get consistent locking.

  reply	other threads:[~2008-07-02 16:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02  8:54 [ofa-general] locking requirements when calling dev_set_mtu() Eli Cohen
2008-07-02 16:41 ` Stephen Hemminger [this message]
2008-07-02 17:15 ` [ofa-general] " Ben Hutchings

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=20080702094140.032efd28@extreme \
    --to=shemminger@vyatta.com \
    --cc=eli@dev.mellanox.co.il \
    --cc=fubar@us.ibm.com \
    --cc=general@lists.openfabrics.org \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@voltaire.com \
    --cc=rdreier@cisco.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 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.