netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <cwang@twopensource.com>
To: Amir Vadai <amirv@mellanox.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Ido Shamay <idos@mellanox.com>, netdev <netdev@vger.kernel.org>,
	Yevgeny Petrilin <yevgenyp@mellanox.com>,
	Or Gerlitz <ogerlitz@mellanox.com>
Subject: Re: [PATCH net] net/mlx4_en: mlx4_en_netpoll shouldn't call napi_schedule when port is down
Date: Mon, 29 Sep 2014 09:47:30 -0700	[thread overview]
Message-ID: <CAHA+R7O_QicCpZNpWzWGD_bGD7i4-ySVjV5UuUVpF8EMsohsPg@mail.gmail.com> (raw)
In-Reply-To: <1411988695-30547-1-git-send-email-amirv@mellanox.com>

On Mon, Sep 29, 2014 at 4:04 AM, Amir Vadai <amirv@mellanox.com> wrote:
> From: Ido Shamay <idos@mellanox.com>
>
> mlx4_en_netpoll, which is mlx4_en ndo_poll_controller callback,
> might be called when port is down, causing a napi_schedule when
> napi->poll callback in NULL. mutex_trylock is needed to acquire
> the port_state lock, since other threads may grab it and stop
> the port while we are in napi scheduling. Using trylock since in atomic
> context.

Are you sure it's safe? Its comment says:

 * This function must not be used in interrupt context. The
 * mutex must be released by the same task that acquired it.

Did you test it with LOCKDEP enabled?

  reply	other threads:[~2014-09-29 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 11:04 [PATCH net] net/mlx4_en: mlx4_en_netpoll shouldn't call napi_schedule when port is down Amir Vadai
2014-09-29 16:47 ` Cong Wang [this message]
2014-09-29 17:47 ` David Miller
2014-10-20 15:59   ` Ido Shamay

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=CAHA+R7O_QicCpZNpWzWGD_bGD7i4-ySVjV5UuUVpF8EMsohsPg@mail.gmail.com \
    --to=cwang@twopensource.com \
    --cc=amirv@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=idos@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=yevgenyp@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;
as well as URLs for NNTP newsgroup(s).