From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Mark Asselstine <asselsm@gmail.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>,
rt2x00 Users List <users@rt2x00.serialmonkey.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] rt2x00: rt2x00queue: avoid using more headroom then driver requested
Date: Wed, 8 Oct 2014 15:00:06 +0200 [thread overview]
Message-ID: <20141008130006.GB5186@redhat.com> (raw)
In-Reply-To: <CAPuovEJXkRYyWXZJD7E6_1EqemfJus7Gtr_5PztT6rDtsrRpdw@mail.gmail.com>
On Wed, Oct 08, 2014 at 07:46:33AM -0400, Mark Asselstine wrote:
> > If rt2x00 does not remove the alignment from the frame before giving it back
> > to mac80211 and the same frame comes into rt2x00 again it should be correctly
> > aligned and no additional header space is required. So this should be fine.
>
> Then I would say this definitely hints at a design flaw in
> rt2x00queue_insert_l2pad(). Take the following scenario.
>
> * skb's first arrival in rt2x00queue_insert_l2pad(), 3 bytes needed
> for frame alignment, 2 bytes for l2pad results in 3 bytes of headroom
> taken.
Not quite realistic assumption - header length will have to be odd then.
But if such situation would happen we will have:
header_align=2, payload_align=3, l2pad=3
Since payload_align will be bigger than header_align, header_align will
be increased to 6.
Header will be moved by 6 bytes, frame will be moved by 3 bytes,
between header and frame there will be l2pad equal to 3.
> * rt2x00lib_txdone() returns 2 bytes of headroom
Return 3 bytes.
> * skb's second arrival in rt2x00queue_insert_l2pad(), 0 bytes needed
> for frame alignment, 2 bytes for l2pad results in 4 bytes of headroom
> taken.
Header will be moved by 3 bytes.
> * rt2x00lib_txdone() returns 2 bytes of headroom
Return 3 bytes.
> Basically as long as any bytes are required for l2pad the headroom
> will lose 4 bytes again and again, never being returned by
> rt2x00lib_txdone().
I think that's not true - you made a few mistakes in your scenario,
but perhaps I'm wrong :-)
Stanislaw
next prev parent reply other threads:[~2014-10-08 13:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 3:45 [PATCH] rt2x00: rt2x00queue: avoid using more headroom then driver requested Mark Asselstine
2014-10-01 9:12 ` Stanislaw Gruszka
[not found] ` <CAPuovEJtuJdRakwRhdUjRwrmkfry62wJqd8p2uJQ7L0rB7DoCA@mail.gmail.com>
2014-10-04 23:38 ` Mark Asselstine
2014-10-05 8:39 ` Helmut Schaa
2014-10-08 11:46 ` Mark Asselstine
2014-10-08 13:00 ` Stanislaw Gruszka [this message]
2014-10-08 19:52 ` Mark Asselstine
2014-10-09 3:34 ` Mark Asselstine
2014-10-09 9:40 ` Stanislaw Gruszka
2014-10-05 13:13 ` Stanislaw Gruszka
2014-10-05 18:28 ` Stanislaw Gruszka
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=20141008130006.GB5186@redhat.com \
--to=sgruszka@redhat.com \
--cc=asselsm@gmail.com \
--cc=helmut.schaa@googlemail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=users@rt2x00.serialmonkey.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).