public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’
       [not found]         ` <1244940182.12000.5.camel@HP1>
@ 2009-06-14  1:33           ` James Bottomley
  2009-06-14  2:18             ` Michael Chan
  2009-06-15  1:27             ` -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’ Mike Christie
  0 siblings, 2 replies; 5+ messages in thread
From: James Bottomley @ 2009-06-14  1:33 UTC (permalink / raw)
  To: Michael Chan
  Cc: Linus Torvalds, Ingo Molnar, Randy Dunlap,
	linux-kernel@vger.kernel.org, David S. Miller, linux-scsi

On Sat, 2009-06-13 at 17:43 -0700, Michael Chan wrote:
> On Sat, 2009-06-13 at 13:42 -0700, James Bottomley wrote:
> > On Sat, 2009-06-13 at 13:11 -0700, Linus Torvalds wrote:
> > > 
> > > 
> > > That makes no sense. 
> > > 
> > > Look at the first #include in the file - it already includes 
> > > <linux/module.h>.
> > > 
> > > Why do we need to do it twice?
> > 
> > We don't ... it's the wrong fix.  The actual problem is that
> > __symbol_get() is only defined for the modular case.  What it looks to
> > be doing is a reflection call on bnx2_cnic_probe().  I'm not sure why
> > it's doing this ... other than perhaps cnic wants to avoid an explicit
> > bnx2 dependency?  I actually think it's incorrect, since the netdev code
> > before it just checked bnx2 is present, so I see no harm in an explicit
> > call, so this should fix it.
> > 
> > If it had a good reason for the reflective call, then symbol_get()
> > without the __ should be used.
> > 
> > Michael Chan, could you confirm?
> > 
> Thanks James and Ingo.  We don't want to have a symbol dependency on
> bnx2 because this driver eventually will support the 10G bnx2x driver as
> well.  So we want the driver to support either or both NIC drivers
> without both drivers loaded.  Please use the patch below.

Um, but that's not going to work very well.  When you have your 10G
driver, they'll both have to export the symbol name bnx2_cnic_probe
which the kernel isn't going to like.  You can differentiate the symbols
and add a multiple symbol lookup in init_bnx2_cnic(), but that's getting
ugly.

What about doing something more standard, like bus matching?  That's how
the SCSI upper layer drivers work:  we export a virtual SCSI bus and
they bind to it if a supporting device appears.  You could do something
similar exporting a virtual cnic bus from your network drivers and get
the cnic driver to bind to it.

James



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’
  2009-06-14  1:33           ` -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’ James Bottomley
@ 2009-06-14  2:18             ` Michael Chan
  2009-06-14 14:15               ` James Bottomley
  2009-06-15  1:27             ` -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’ Mike Christie
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Chan @ 2009-06-14  2:18 UTC (permalink / raw)
  To: James Bottomley
  Cc: Linus Torvalds, Ingo Molnar, Randy Dunlap,
	linux-kernel@vger.kernel.org, David S. Miller, linux-scsi


On Sat, 2009-06-13 at 18:33 -0700, James Bottomley wrote:
> On Sat, 2009-06-13 at 17:43 -0700, Michael Chan wrote:
> > On Sat, 2009-06-13 at 13:42 -0700, James Bottomley wrote:
> > > On Sat, 2009-06-13 at 13:11 -0700, Linus Torvalds wrote:
> > > > 
> > > > 
> > > > That makes no sense. 
> > > > 
> > > > Look at the first #include in the file - it already includes 
> > > > <linux/module.h>.
> > > > 
> > > > Why do we need to do it twice?
> > > 
> > > We don't ... it's the wrong fix.  The actual problem is that
> > > __symbol_get() is only defined for the modular case.  What it looks to
> > > be doing is a reflection call on bnx2_cnic_probe().  I'm not sure why
> > > it's doing this ... other than perhaps cnic wants to avoid an explicit
> > > bnx2 dependency?  I actually think it's incorrect, since the netdev code
> > > before it just checked bnx2 is present, so I see no harm in an explicit
> > > call, so this should fix it.
> > > 
> > > If it had a good reason for the reflective call, then symbol_get()
> > > without the __ should be used.
> > > 
> > > Michael Chan, could you confirm?
> > > 
> > Thanks James and Ingo.  We don't want to have a symbol dependency on
> > bnx2 because this driver eventually will support the 10G bnx2x driver as
> > well.  So we want the driver to support either or both NIC drivers
> > without both drivers loaded.  Please use the patch below.
> 
> Um, but that's not going to work very well.  When you have your 10G
> driver, they'll both have to export the symbol name bnx2_cnic_probe
> which the kernel isn't going to like.  You can differentiate the symbols
> and add a multiple symbol lookup in init_bnx2_cnic(), but that's getting
> ugly.

Yeah, the plan is to have a bnx2x_cnic_probe() when we add support for
that.  There will be a separate init_bnx2x_cnic() because the hardware
interface is not exactly the same.

> 
> What about doing something more standard, like bus matching?  That's how
> the SCSI upper layer drivers work:  we export a virtual SCSI bus and
> they bind to it if a supporting device appears.  You could do something
> similar exporting a virtual cnic bus from your network drivers and get
> the cnic driver to bind to it.
> 

This will require some additional infra-structure.  We can look into
this when we support the 10G driver.  Thanks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’
  2009-06-14  2:18             ` Michael Chan
@ 2009-06-14 14:15               ` James Bottomley
  2009-06-14 14:51                 ` -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function '__symbol_get' Michael Chan
  0 siblings, 1 reply; 5+ messages in thread
From: James Bottomley @ 2009-06-14 14:15 UTC (permalink / raw)
  To: Michael Chan
  Cc: Linus Torvalds, Ingo Molnar, Randy Dunlap,
	linux-kernel@vger.kernel.org, David S. Miller, linux-scsi

On Sat, 2009-06-13 at 19:18 -0700, Michael Chan wrote:
> On Sat, 2009-06-13 at 18:33 -0700, James Bottomley wrote:
> > On Sat, 2009-06-13 at 17:43 -0700, Michael Chan wrote:
[...]
> > > Thanks James and Ingo.  We don't want to have a symbol dependency on
> > > bnx2 because this driver eventually will support the 10G bnx2x driver as
> > > well.  So we want the driver to support either or both NIC drivers
> > > without both drivers loaded.  Please use the patch below.
> > 
> > Um, but that's not going to work very well.  When you have your 10G
> > driver, they'll both have to export the symbol name bnx2_cnic_probe
> > which the kernel isn't going to like.  You can differentiate the symbols
> > and add a multiple symbol lookup in init_bnx2_cnic(), but that's getting
> > ugly.
> 
> Yeah, the plan is to have a bnx2x_cnic_probe() when we add support for
> that.  There will be a separate init_bnx2x_cnic() because the hardware
> interface is not exactly the same.
> 
> > 
> > What about doing something more standard, like bus matching?  That's how
> > the SCSI upper layer drivers work:  we export a virtual SCSI bus and
> > they bind to it if a supporting device appears.  You could do something
> > similar exporting a virtual cnic bus from your network drivers and get
> > the cnic driver to bind to it.
> > 
> 
> This will require some additional infra-structure.  We can look into
> this when we support the 10G driver.  Thanks.

So if you're going to redo it for the 10G driver, and without the 10G
driver there really seems no need to have a call by reflection in there,
why not simply do a direct call until the 10G driver is added?  This
will save everyone potential hassle from what is a highly unusual
interface.

James



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function '__symbol_get'
  2009-06-14 14:15               ` James Bottomley
@ 2009-06-14 14:51                 ` Michael Chan
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2009-06-14 14:51 UTC (permalink / raw)
  To: 'James Bottomley'
  Cc: Linus Torvalds, Ingo Molnar, Randy Dunlap,
	linux-kernel@vger.kernel.org, David S. Miller, linux-scsi

James Bottomley wrote:

> On Sat, 2009-06-13 at 19:18 -0700, Michael Chan wrote:
> >
> > This will require some additional infra-structure.  We can look into
> > this when we support the 10G driver.  Thanks.
>
> So if you're going to redo it for the 10G driver, and without the 10G
> driver there really seems no need to have a call by
> reflection in there,
> why not simply do a direct call until the 10G driver is added?  This
> will save everyone potential hassle from what is a highly unusual
> interface.
>

There's an additional usage issue if we switch to a direct call.  The
cnic driver will now have a permanent reference on the bnx2 driver
after it is loaded.  Networking users will be unable to unload the
bnx2 driver once the cnic driver is loaded.

This may not be a serious issue, but one of the goals of the design is
to have minmal impact on networking users.  Since kernel 2.6, users
have been able to unload networking drivers at any time.

Thanks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’
  2009-06-14  1:33           ` -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’ James Bottomley
  2009-06-14  2:18             ` Michael Chan
@ 2009-06-15  1:27             ` Mike Christie
  1 sibling, 0 replies; 5+ messages in thread
From: Mike Christie @ 2009-06-15  1:27 UTC (permalink / raw)
  To: James Bottomley
  Cc: Michael Chan, Linus Torvalds, Ingo Molnar, Randy Dunlap,
	linux-kernel@vger.kernel.org, David S. Miller, linux-scsi

James Bottomley wrote:
> On Sat, 2009-06-13 at 17:43 -0700, Michael Chan wrote:
>> On Sat, 2009-06-13 at 13:42 -0700, James Bottomley wrote:
>>> On Sat, 2009-06-13 at 13:11 -0700, Linus Torvalds wrote:
>>>>
>>>> That makes no sense. 
>>>>
>>>> Look at the first #include in the file - it already includes 
>>>> <linux/module.h>.
>>>>
>>>> Why do we need to do it twice?
>>> We don't ... it's the wrong fix.  The actual problem is that
>>> __symbol_get() is only defined for the modular case.  What it looks to
>>> be doing is a reflection call on bnx2_cnic_probe().  I'm not sure why
>>> it's doing this ... other than perhaps cnic wants to avoid an explicit
>>> bnx2 dependency?  I actually think it's incorrect, since the netdev code
>>> before it just checked bnx2 is present, so I see no harm in an explicit
>>> call, so this should fix it.
>>>
>>> If it had a good reason for the reflective call, then symbol_get()
>>> without the __ should be used.
>>>
>>> Michael Chan, could you confirm?
>>>
>> Thanks James and Ingo.  We don't want to have a symbol dependency on
>> bnx2 because this driver eventually will support the 10G bnx2x driver as
>> well.  So we want the driver to support either or both NIC drivers
>> without both drivers loaded.  Please use the patch below.
> 
> Um, but that's not going to work very well.  When you have your 10G
> driver, they'll both have to export the symbol name bnx2_cnic_probe
> which the kernel isn't going to like.  You can differentiate the symbols
> and add a multiple symbol lookup in init_bnx2_cnic(), but that's getting
> ugly.
> 
> What about doing something more standard, like bus matching?  That's how
> the SCSI upper layer drivers work:  we export a virtual SCSI bus and
> they bind to it if a supporting device appears.  You could do something
> similar exporting a virtual cnic bus from your network drivers and get
> the cnic driver to bind to it.
> 

Something like bus matching would be nice. I think this is going to be a 
bigger problem in the future with everyone putting as many functions on 
a card as possible. We already have the cxgb3 net driver with a iwarp 
(iw_cxgb3) and iscsi (cxgb3i) driver, so maybe something in the net or 
driver model code would be best?

Today, you can't have two pci_drivers attaching to the same device can you?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-15  1:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090612184343.GA11900@elte.hu>
     [not found] ` <4A32A1E4.8080708@oracle.com>
     [not found]   ` <20090613062933.GA14034@elte.hu>
     [not found]     ` <alpine.LFD.2.01.0906131309560.3237@localhost.localdomain>
     [not found]       ` <1244925747.5323.57.camel@mulgrave.site>
     [not found]         ` <1244940182.12000.5.camel@HP1>
2009-06-14  1:33           ` -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’ James Bottomley
2009-06-14  2:18             ` Michael Chan
2009-06-14 14:15               ` James Bottomley
2009-06-14 14:51                 ` -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function '__symbol_get' Michael Chan
2009-06-15  1:27             ` -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function ‘__symbol_get’ Mike Christie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox