From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: Hariprasad S <hariprasad@chelsio.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, leedom@chelsio.com,
anish@chelsio.com, nirranjan@chelsio.com, kumaras@chelsio.com,
swise@opengridcomputing.com
Subject: Re: [PATCH net 2/2] cxgb4: Disable interrupts and napi before unregistering netdev
Date: Sat, 28 Mar 2015 05:20:37 +0100 [thread overview]
Message-ID: <55162C15.1000807@gmx.de> (raw)
In-Reply-To: <20150327085447.GA20708@hariprasad-pc.asicdesigners.com>
On 27.03.2015 09:54, Hariprasad S wrote:
>>
>> just out of curiousity: How can an unregister of a netdevice lead to a
>> crash caused by traffic? I understand that _freeing_ the device or other
>> resources is a bad idea as long as irqs are still active. But unregister
>> should not do anything critical (i am asking since I want to avoid such
>> problems in my own drivers).
>>
>> Regards,
>> Lino
>>
>
> When device is unregistered ip_ptr of net_device structure is set to NULL.
> Since NAPI is not disabled, every packet goes through ip_error() check.
> And in ip_error() function when in_device structure is obtained from netdevice
> structure, it ends up in NULL pointer dereference since ip_ptr is already NULL.
>
> Regards,
> Hari
>
Ah ok, that makes sense. I missed the cleanup done due to netdev
notifier calls (in this case ip_netdev_notifier). Thanks for pointing
this out.
Regards,
Lino
next prev parent reply other threads:[~2015-03-28 4:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 4:34 [PATCH net 0/2] Fixes ingress queue mapping and other fixes Hariprasad Shenai
2015-03-26 4:34 ` [PATCH net 1/2] cxgb4: Allocate dynamic mem. for egress and ingress queue maps Hariprasad Shenai
2015-03-26 4:34 ` [PATCH net 2/2] cxgb4: Disable interrupts and napi before unregistering netdev Hariprasad Shenai
2015-03-26 21:02 ` Lino Sanfilippo
2015-03-27 8:54 ` Hariprasad S
2015-03-28 4:20 ` Lino Sanfilippo [this message]
2015-03-29 19:26 ` [PATCH net 0/2] Fixes ingress queue mapping and other fixes David Miller
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=55162C15.1000807@gmx.de \
--to=linosanfilippo@gmx.de \
--cc=anish@chelsio.com \
--cc=davem@davemloft.net \
--cc=hariprasad@chelsio.com \
--cc=kumaras@chelsio.com \
--cc=leedom@chelsio.com \
--cc=netdev@vger.kernel.org \
--cc=nirranjan@chelsio.com \
--cc=swise@opengridcomputing.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).