From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brad Plant Subject: Re: pvops netconsole Date: Sun, 14 Feb 2010 13:28:20 +1100 Message-ID: <20100214132820.4bfbd0d7@daedalus> References: <20100205111507.4e7089fd@daedalus> <4B75DF98.3070307@goop.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0905907620==" Return-path: In-Reply-To: <4B75DF98.3070307@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============0905907620== Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/q9ylwNao=68aj.80R9ZHLb1"; protocol="application/pgp-signature" --Sig_/q9ylwNao=68aj.80R9ZHLb1 Content-Type: multipart/mixed; boundary="MP_/ipr_Vz7rCFpvI68faQoyCpD" --MP_/ipr_Vz7rCFpvI68faQoyCpD Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Fri, 12 Feb 2010 15:09:12 -0800 Jeremy Fitzhardinge 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 > > =20 >=20 > The xen-netfront device doesn't support the polling interface that=20 > netconsole relies on. It probably wouldn't be too hard to add that=20 > capability if you want to. It's independent of the backend and/or the=20 > actual underlying hardware device. Ok, I've come up with something that "works". Patch against 2.6.32.7 is att= ached. 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 a= lready 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 y= et have a mac address as setup_netfront hadn't yet been called. I changed t= he module_init() in netconsole.c to late_initcall() if !CONFIG_MODULES && C= ONFIG_XEN. Is this allowed and sane? Cheers, Brad --MP_/ipr_Vz7rCFpvI68faQoyCpD Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=xen-netconsole.patch diff -urpNX linux-2.6.32.7/Documentation/dontdiff linux-2.6.32.7/drivers/ne= t/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 } } =20 +#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/ne= t/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; } =20 +#ifdef CONFIG_NET_POLL_CONTROLLER +static void xennet_netpoll(struct net_device *dev) +{ + struct netfront_info *np =3D netdev_priv(dev); + + napi_schedule(&np->napi); +} +#endif + static int xennet_change_mtu(struct net_device *dev, int mtu) { int max =3D xennet_can_sg(dev) ? 65535 - ETH_HLEN : ETH_DATA_LEN; @@ -1113,6 +1122,9 @@ static const struct net_device_ops xenne .ndo_change_mtu =3D xennet_change_mtu, .ndo_set_mac_address =3D eth_mac_addr, .ndo_validate_addr =3D eth_validate_addr, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller =3D xennet_netpoll, +#endif }; =20 static struct net_device * __devinit xennet_create_dev(struct xenbus_devic= e *dev) --MP_/ipr_Vz7rCFpvI68faQoyCpD-- --Sig_/q9ylwNao=68aj.80R9ZHLb1 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkt3X8QACgkQtFxK98yAy+k1EQCePrwQjef+EfZajnK41J5aFIml TyQAnRmxAVLTiKDJZlfkbP0HLfeeaY/G =lYrX -----END PGP SIGNATURE----- --Sig_/q9ylwNao=68aj.80R9ZHLb1-- --===============0905907620== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0905907620==--