All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Brad Plant <bplant@iinet.net.au>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: pvops netconsole
Date: Mon, 15 Feb 2010 17:22:56 -0800	[thread overview]
Message-ID: <4B79F370.4040202@goop.org> (raw)
In-Reply-To: <20100214155635.17d57bf7@daedalus>

On 02/13/2010 08:56 PM, Brad Plant wrote:
> Actually, I tried something like this first because I first looked at pcnet32.c and e100.c:
>
> disable_irq(dev->irq);
> xennet_interrupt(dev->irq, dev);
> enable_irq(dev->irq);
>
> The same WARN_ONCE() was triggered.
>    

Given that netconsole works with e1000 (I presume; haven't tested it 
lately), I guess it needs a close look to see what differs from the 
netfront case.

>>> 3. Initially netconsole would not initialise because the interface didn't yet have a mac address as setup_netfront hadn't yet been called. I changed the module_init() in netconsole.c to late_initcall() if !CONFIG_MODULES&&   CONFIG_XEN. Is this allowed and sane?
>>>        
>> Probably not.  In practice every kernel will have modules and Xen
>> enabled, and it will change netconsole for all users.  I guess we
>> probably need to find some way to init the MAC address earlier, or
>> trigger netconsole init once the mac address is known.
>>      
> I figured it was dodgy. How would you init the MAC address earlier though? I've observed the xen devices being initialised at slightly different times with respect to other devices which suggests to me that they (and possibly all devices) are being initialised in separate threads. It would mean setting the MAC address before device initialisation yes?
>
> Not sure how correct this is either, but another solution might be to set the MAC address to say 00:00:00:00:00:01 when the netdev structure is first created. This lets netconsole initialise since the MAC address isn't all zeros or all 0xFF. By the time any net console logs are transmitted, setup_netfront will have already been called and the correct MAC address set so no packets will actually be sent with the above MAC address. I have attached a patch that does this.
>    

That seems a bit sketchy.

netfront is like a lot of network devices; it needs to query some 
external source to find its own mac address.  Mostly this means querying 
some eeprom over i2c or something, but in our case it means talking to 
xenstore to find the configured mac address.  I think the problem here 
is that this happens asynchronously, rather than synchronously in the 
net device's init routine.  One fix might be to synchronously wait for 
the mac address to be set before returning from the init function.

     J

      reply	other threads:[~2010-02-16  1:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05  0:15 pvops netconsole Brad Plant
2010-02-05 16:34 ` Konrad Rzeszutek Wilk
2010-02-05 20:21   ` Brad Plant
2010-02-12 23:09 ` Jeremy Fitzhardinge
2010-02-13  0:05   ` Brad Plant
2010-02-14  2:28   ` Brad Plant
2010-02-14  3:56     ` Jeremy Fitzhardinge
2010-02-14  4:56       ` Brad Plant
2010-02-16  1:22         ` Jeremy Fitzhardinge [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=4B79F370.4040202@goop.org \
    --to=jeremy@goop.org \
    --cc=bplant@iinet.net.au \
    --cc=xen-devel@lists.xensource.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.