xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Brad Plant <bplant@iinet.net.au>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: pvops netconsole
Date: Sun, 14 Feb 2010 13:28:20 +1100	[thread overview]
Message-ID: <20100214132820.4bfbd0d7@daedalus> (raw)
In-Reply-To: <4B75DF98.3070307@goop.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 1674 bytes --]

On Fri, 12 Feb 2010 15:09:12 -0800
Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> On 02/04/2010 04:15 PM, Brad Plant wrote:
> > Initialising Xen virtual ethernet driver.
> > blkfront: xvda1: barriers enabled
> > netconsole: local port 11111
> > netconsole: local IP 10.20.40.2
> > netconsole: interface eth1
> > netconsole: remote port 9514
> > netconsole: remote IP 10.20.50.2
> > netconsole: remote ethernet address 00:16:3e:00:50:02
> > netconsole: eth1 doesn't support polling, aborting.
> > netconsole: cleaning up
> >    
> 
> The xen-netfront device doesn't support the polling interface that 
> netconsole relies on.  It probably wouldn't be too hard to add that 
> capability if you want to.  It's independent of the backend and/or the 
> actual underlying hardware device.

Ok, I've come up with something that "works". Patch against 2.6.32.7 is attached. While it works, I've got no idea if what I've done is the "right way". I used virtio_net.c as a guide.

I've got some issues that I'm stuck on and would like some guidance:

1. When the first message is sent over the net console, the WARN_ONCE() at net/core/netpoll.c:327 triggers. I'm not sure what to do about this.

2. When either netconsole is setup or the first message is sent, messages already logged to the main console get logged again. Maybe this will go away when the above is fixed?

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?

Cheers,

Brad

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: xen-netconsole.patch --]
[-- Type: text/x-patch, Size: 1693 bytes --]

diff -urpNX linux-2.6.32.7/Documentation/dontdiff linux-2.6.32.7/drivers/net/netconsole.c linux-2.6.32.7-xen-netconsole/drivers/net/netconsole.c
--- linux-2.6.32.7/drivers/net/netconsole.c	2009-12-03 14:51:21.000000000 +1100
+++ linux-2.6.32.7-xen-netconsole/drivers/net/netconsole.c	2010-02-14 12:37:00.000000000 +1100
@@ -816,5 +816,13 @@ static void __exit cleanup_netconsole(vo
 	}
 }
 
+#ifndef CONFIG_MODULES
+#ifdef CONFIG_XEN
+late_initcall(init_netconsole);
+#else
 module_init(init_netconsole);
+#endif
+#else
+module_init(init_netconsole);
+#endif
 module_exit(cleanup_netconsole);
diff -urpNX linux-2.6.32.7/Documentation/dontdiff linux-2.6.32.7/drivers/net/xen-netfront.c linux-2.6.32.7-xen-netconsole/drivers/net/xen-netfront.c
--- linux-2.6.32.7/drivers/net/xen-netfront.c	2009-12-03 14:51:21.000000000 +1100
+++ linux-2.6.32.7-xen-netconsole/drivers/net/xen-netfront.c	2010-02-14 12:58:22.000000000 +1100
@@ -989,6 +989,15 @@ err:
 	return work_done;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void xennet_netpoll(struct net_device *dev)
+{
+	struct netfront_info *np = netdev_priv(dev);
+
+	napi_schedule(&np->napi);
+}
+#endif
+
 static int xennet_change_mtu(struct net_device *dev, int mtu)
 {
 	int max = xennet_can_sg(dev) ? 65535 - ETH_HLEN : ETH_DATA_LEN;
@@ -1113,6 +1122,9 @@ static const struct net_device_ops xenne
 	.ndo_change_mtu	     = xennet_change_mtu,
 	.ndo_set_mac_address = eth_mac_addr,
 	.ndo_validate_addr   = eth_validate_addr,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller = xennet_netpoll,
+#endif
 };
 
 static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev)

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2010-02-14  2:28 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 [this message]
2010-02-14  3:56     ` Jeremy Fitzhardinge
2010-02-14  4:56       ` Brad Plant
2010-02-16  1:22         ` Jeremy Fitzhardinge

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=20100214132820.4bfbd0d7@daedalus \
    --to=bplant@iinet.net.au \
    --cc=jeremy@goop.org \
    --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 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).