From: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
To: dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org,
"Eric W. Biederman"
<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Subject: Re: [patch 1/1] fix bad netif_carrier_off place
Date: Wed, 19 Sep 2007 12:35:43 +0400 [thread overview]
Message-ID: <46F0DF5F.9080905@openvz.org> (raw)
In-Reply-To: <20070918170430.254614330-WECHFHqYCmGD/CxQmPlnQ0FT0OZdM7KVQQ4Iyu8u01E@public.gmane.org>
> From: Daniel Lezcano <dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
>
> If the netif_carrier_off is called before register_netdev
> that will use and generate an event for a non initialized network
> device and that leads to a Oops.
>
> I moved the netif_carrier_off from the setup function after each
> register_netdev call.
>
> Signed-off-by: Daniel Lezcano <dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
Acked-by: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
Eric, if you managed to reproduce your oopses, does this patch help?
BTW, this problem exists for some other drivers, no? E.g.
xpnet_init() does the same thing and probably oopses as well.
> ---
> drivers/net/veth.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> Index: net-2.6.24/drivers/net/veth.c
> ===================================================================
> --- net-2.6.24.orig/drivers/net/veth.c
> +++ net-2.6.24/drivers/net/veth.c
> @@ -286,7 +286,6 @@ static void veth_setup(struct net_device
> dev->features |= NETIF_F_LLTX;
> dev->init = veth_dev_init;
> dev->destructor = veth_dev_free;
> - netif_carrier_off(dev);
> }
>
> /*
> @@ -357,6 +356,8 @@ static int veth_newlink(struct net_devic
> if (err < 0)
> goto err_register_peer;
>
> + netif_carrier_off(peer);
> +
> /*
> * register dev last
> *
> @@ -382,6 +383,8 @@ static int veth_newlink(struct net_devic
> if (err < 0)
> goto err_register_dev;
>
> + netif_carrier_off(dev);
> +
> /*
> * tie the deviced together
> */
>
> --
prev parent reply other threads:[~2007-09-19 8:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 16:56 [patch 0/1] fix veth netif_carrier_off dlezcano-NmTC/0ZBporQT0dZR+AlfA
2007-09-18 16:56 ` [patch 1/1] fix bad netif_carrier_off place dlezcano-NmTC/0ZBporQT0dZR+AlfA
[not found] ` <20070918170430.254614330-WECHFHqYCmGD/CxQmPlnQ0FT0OZdM7KVQQ4Iyu8u01E@public.gmane.org>
2007-09-19 8:35 ` Pavel Emelyanov [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=46F0DF5F.9080905@openvz.org \
--to=xemul-gefaqzzx7r8dnm+yrofe0a@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.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