netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: yuvalmin@broadcom.com
Cc: netdev@vger.kernel.org, ariele@broadcom.com, eilong@broadcom.com
Subject: Re: [PATCH net-next] bnx2x: Revising locking scheme for MAC configuration
Date: Thu, 01 Aug 2013 15:56:59 -0700 (PDT)	[thread overview]
Message-ID: <20130801.155659.2230904456508730148.davem@davemloft.net> (raw)
In-Reply-To: <1375367459-11832-1-git-send-email-yuvalmin@broadcom.com>

From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Thu, 1 Aug 2013 17:30:59 +0300

> On very rare occasions, repeated load/unload stress test in the presence of
> our storage driver (bnx2i/bnx2fc) causes a kernel panic in bnx2x code
> (NULL pointer dereference). Stack traces indicate the issue happens during MAC
> configuration; thorough code review showed that indeed several races exist
> in which one thread can iterate over the list of configured MACs while another
> deletes entries from the same list.
> 
> This patch adds a varient on the single-writer/Multiple-reader lock mechanism -
> It utilizes an already exsiting bottom-half lock, using it so that Whenever
> a writer is unable to continue due to the existence of another writer/reader,
> it pends its request for future deliverance.
> The writer / last readers will check for the existence of such requests and
> perform them instead of the original initiator.
> This prevents the writer from having to sleep while waiting for the lock
> to be accessible, which might cause deadlocks given the locks already
> held by the writer.
> 
> Another result of this patch is that setting of Rx Mode is now made in
> sleepable context - Setting of Rx Mode is made under a bottom-half lock, which
> was always nontrivial for the bnx2x driver, as the HW/FW configuration requires
> wait for completions.
> Since sleep was impossible (due to the sleepless-context), various mechanisms
> were utilized to prevent the calling thread from sleep, but the truth was that
> when the caller thread (i.e, the one calling ndo_set_rx_mode()) returned, the
> Rx mode was still not set in HW/FW.
> 
> bnx2x_set_rx_mode() will now overtly schedule for the Rx changes to be
> configured by the sp_rtnl_task which hold the RTNL lock and is sleepable
> context. 
> 
> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
> Signed-off-by: Ariel Elior <ariele@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied to net-next, thanks.

      reply	other threads:[~2013-08-01 22:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 14:30 [PATCH net-next] bnx2x: Revising locking scheme for MAC configuration Yuval Mintz
2013-08-01 22:56 ` 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=20130801.155659.2230904456508730148.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ariele@broadcom.com \
    --cc=eilong@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=yuvalmin@broadcom.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).