netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Michael Buesch <mb@bu3sch.de>
Cc: Jeff Garzik <jeff@garzik.org>, Michael Chan <mchan@broadcom.com>,
	davem@davemloft.net, netdev@vger.kernel.org,
	eliezert@broadcom.com, lusinsky@broadcom.com,
	eilong@broadcom.com
Subject: Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
Date: Wed, 8 Aug 2007 00:04:59 +0100	[thread overview]
Message-ID: <20070807230458.GA9883@infradead.org> (raw)
In-Reply-To: <200708080020.35701.mb@bu3sch.de>

On Wed, Aug 08, 2007 at 12:20:35AM +0200, Michael Buesch wrote:
> On Wednesday 08 August 2007 00:15:47 Jeff Garzik wrote:
> > Michael Buesch wrote:
> > > On Wednesday 01 August 2007 10:31:17 Michael Chan wrote:
> > >> +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
> > >> +{
> > >> +	struct net_device *dev = dev_instance;
> > > 
> > > You need to check if dev==NULL and bail out.
> > > Another driver sharing the IRQ with this might choose to pass the dev
> > > pointer as NULL.
> > 
> > NAK that advice:  It is pointless having such a check in the hottest of 
> > driver hot paths, since a large majority of drivers do not have such a 
> > check.
> > 
> > It is better to fix the extremely rare oddball that passes NULL to 
> > request_irq(), than to update all drivers to be slower due to the oddballs.
> 
> Ah, well. IMO one should better go safe than Oops. ;)
> It's not that an if branch takes more than 2 or 3 CPU cycles at worst.
> But well, if you don't like it, I can live without it, too.

Please take a look at kernel/irq/handle.c.  The irq handler is
always called with the right dev_id argument.  Everything would be a complete
nightmare to handle because you usually need to access the device private
data to check whether the shared irq is for this device.

  reply	other threads:[~2007-08-07 23:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-01  8:31 [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet Michael Chan
2007-08-01 22:06 ` Michael Buesch
2007-08-01 22:28   ` Roland Dreier
2007-08-01 22:50     ` Jeff Garzik
2007-08-02 18:13       ` Eliezer Tamir
2007-08-02 18:09   ` Eliezer Tamir
2007-08-02 21:48   ` Michael Chan
2007-08-07 22:15   ` Jeff Garzik
2007-08-07 22:20     ` Michael Buesch
2007-08-07 23:04       ` Christoph Hellwig [this message]
2007-08-07 23:08         ` David Miller
2007-08-08  8:40           ` Michael Buesch
2007-08-07 23:04   ` Roland Dreier

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=20070807230458.GA9883@infradead.org \
    --to=hch@infradead.org \
    --cc=davem@davemloft.net \
    --cc=eilong@broadcom.com \
    --cc=eliezert@broadcom.com \
    --cc=jeff@garzik.org \
    --cc=lusinsky@broadcom.com \
    --cc=mb@bu3sch.de \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /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).