From: Helmut Schaa <helmut.schaa@googlemail.com>
To: Zhu Yi <yi.zhu@intel.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
linux-wireless@vger.kernel.org, Jouni Malinen <j@w1.fi>
Subject: Re: [Ipw2100-devel] ipw2100: race between isr_indicate_associated and rx path
Date: Tue, 24 Feb 2009 13:15:42 +0100 [thread overview]
Message-ID: <200902241315.43128.helmut.schaa@gmail.com> (raw)
In-Reply-To: <1235446447.6354.549.camel@debian>
Am Dienstag, 24. Februar 2009 schrieb Zhu Yi:
[...]
> Thanks for the analysis. Are you sure noop_qdisc is still used when we
> are about to netif_carrier_on() after receiving the association success
> response?
Yes, had a printk in noop_enqueue.
> From dev_open(), dev_activate() is called after netdev->open.
> So the txq->qdisc_sleeping should be already replaced with pfifo_fast.
> But the state is still DEACTIVATED.
Right. But for example when a connection cannot be established by ipw2100
it will call netif_carrier_off on disassociation which in turn leads to a
call to dev_deavtivate. Hence, it is possible that a noop_qdisc is
assigned while the device is up and carrier is off.
> Should the packet from
> wpa_supplicant be dropped by dev_queue_xmit()?
>
> > So, how should I proceed here?
> >
> > Some possibilities that come to mind:
> >
> > 1) let the noop_qdisc return NET_XMIT_DROP instead of NET_XMIT_CN and extend
> > wpa_supplicant to retry after a short timeout. Already tried this approach
> > and it works fine for me. wpa_supplicant typically needs one retry (200ms
> > delay) until the frame is successfully send out.
> >
> > 2) Run activate_dev somehow without a delay. I guess this could be achieved by
> > changing linkwatch_urgent_event. I haven't tested this yet. But I guess we
> > would still have a small race here.
> >
> > 3) Wait until activate_dev was called in ipw2100 before replaying the cached
> > frames.
>
> I think making a sync version of netif_carrier_on/activate_dev should be
> the way to go. This could be a requirement from wireless. In wired
> network, netif_carrier_on() is called after a network cable plug event
> is detected. Some delay should be OK.
Maybe, but I can imagine a similar race when using a wired 802.1x secured
network. The switch might send an EAP-request very quickly after the carrier
was detected.
> But in wireless,
> netif_carrier_on() is usually called after an association is succeeded.
> The driver has already some management frames transfered with AP. Now
> it's the time to open the data frame transmission. The driver requires
> to get the activate_dev() result (synchronously or via callback) because
> otherwise the driver has no idea when the Qdisc is ready and then it can
> start to deliver data frames to network stack and user space.
Exactly.
[...]
Helmut
next prev parent reply other threads:[~2009-02-24 12:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200901211734.48625.helmut.schaa@gmail.com>
[not found] ` <200901271521.24395.helmut.schaa@gmail.com>
[not found] ` <200902051511.31268.helmut.schaa@gmail.com>
2009-02-23 10:38 ` [Ipw2100-devel] ipw2100: race between isr_indicate_associated and rx path Helmut Schaa
2009-02-23 18:08 ` Jouni Malinen
2009-02-24 7:36 ` Helmut Schaa
[not found] ` <200902231138.58067.helmut.schaa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-24 3:34 ` Zhu Yi
2009-02-24 12:15 ` Helmut Schaa [this message]
[not found] ` <200902241315.43128.helmut.schaa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-25 1:18 ` Zhu Yi
2009-02-25 12:39 ` Helmut Schaa
[not found] ` <200902251340.02010.helmut.schaa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-27 0:55 ` Zhu Yi
2009-03-03 11:33 ` Helmut Schaa
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=200902241315.43128.helmut.schaa@gmail.com \
--to=helmut.schaa@googlemail.com \
--cc=j@w1.fi \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yi.zhu@intel.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).