netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Villací­s Lasso" <avillaci-x0m+Mc+nT7uljOmnV8AmnkElSqmLX1BE@public.gmane.org>
To: irda-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Subject: Re: Regression: Recent networking (qdisc?) patches break irda_get_next_speed()
Date: Wed, 22 Oct 2008 19:24:24 -0500	[thread overview]
Message-ID: <48FFC438.1080505@ceibo.fiec.espol.edu.ec> (raw)
In-Reply-To: <20081021.164121.257737412.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

David Miller escribió:
> From: Alex Villací­s Lasso <avillaci-x0m+Mc+nT7uljOmnV8AmnkElSqmLX1BE@public.gmane.org>
> Date: Tue, 21 Oct 2008 18:37:56 -0500
>
>   
>> So then, the bug is that the cb field in the struct sk_buff is being
>> interpreted as both a struct qdisc_skb_cb and an struct irda_skb_cb,
>> for the same instance of struct sk_buff. I have just started to
>> review the suggested patch, but it seems that 'struct qdisc_skb_cb'
>> was meant to be aliased against the data for other layers (as
>> suggested by the presence of a 'char data[]' field). If so, how come
>> only IrDA is affected? How come UDP, TCP, etc. not affected by this?
>> On the other hand, if qdisc_skb_cb was not meant to be aliased, then
>> the IrDA case was left out while converting the rest of the layers
>> so that they will skip over the member 'pkt_len' of the 'struct
>> qdisc_skb_cb'.
>>     
>
> The SKB control block is not aliased.
>
> Once the packet is given to dev_queue_xmit() the packet scheduler
> "owns" the control block of the SKB.
>
> What IRDA is doing is illegal, and breaks in other ways without the
> commit in question.
>
> IRDA cannot depend upon the SKB control block not changing across
> the dev_queue_xmit() call.
>
>   
Let me see if I understood. So the particular illegal thing the IRDA 
stack is doing is the access of the control block in the middle of the 
driver transmit routine (via irda_get_next_speed() and friends). This 
information should be stored somewhere else. Exactly *where* to store it 
is the main problem to solve.

What is the proper way (if any) to store per-packet parameters (other 
than the payload itself) which are specific to a particular layer (IrDA 
in this case) and which are needed by drivers in order to work 
correctly? The control block gets overwritten by the time the driver 
proc (hard_start_xmit) is called, so this approach is now ruled out. I 
was thinking about storing a copy of the parameters (struct irda_skb_cb) 
as a header within the payload itself (skb->data[]), but I am not sure 
about whether this approach is a good design decision. I am open to 
suggestions on where to place the parameters.

-- 
perl -e '$x=2.4;print sprintf("%.0f + %.0f = %.0f\n",$x,$x,$x+$x);'


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

  parent reply	other threads:[~2008-10-23  0:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 18:20 Regression: Recent networking (qdisc?) patches break irda_get_next_speed() Alex Villací­s Lasso
2008-10-21 19:37 ` Jarek Poplawski
2008-10-21 23:37   ` Alex Villací­s Lasso
2008-10-21 23:41     ` David Miller
     [not found]       ` <20081021.164121.257737412.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-10-23  0:24         ` Alex Villací­s Lasso [this message]
2008-10-23 22:13           ` Brandeburg, Jesse
2008-10-23 23:16             ` Stephen Hemminger
2008-10-24  0:21             ` 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=48FFC438.1080505@ceibo.fiec.espol.edu.ec \
    --to=avillaci-x0m+mc+nt7uljomnv8amnkelsqmlx1be@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=irda-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@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;
as well as URLs for NNTP newsgroup(s).