From: Michael Buesch <mbuesch@freenet.de>
To: James Ketrenos <jketreno@linux.intel.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
ieee80211-devel@lists.sourceforge.net,
bcm43xx-dev@lists.berlios.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH ieee80211] fix TX skb allocation flags and size
Date: Fri, 14 Oct 2005 01:17:21 +0200 [thread overview]
Message-ID: <200510140117.21636.mbuesch@freenet.de> (raw)
In-Reply-To: <434EE7FB.9010506@pobox.com>
[-- Attachment #1.1: Type: text/plain, Size: 2130 bytes --]
On Friday 14 October 2005 01:04, you wrote:
> Michael Buesch wrote:
> > @@ -221,11 +221,13 @@ static struct ieee80211_txb *ieee80211_a
> > txb->frag_size = txb_size;
> >
> > for (i = 0; i < nr_frags; i++) {
> > - txb->fragments[i] = dev_alloc_skb(txb_size);
> > + txb->fragments[i] = __dev_alloc_skb(txb_size + headroom,
> > + gfp_mask | GFP_DMA);
> > if (unlikely(!txb->fragments[i])) {
> > i--;
>
> Very wrong. GFP_DMA means ISA DMA.
>
> See pci_map_xxx() and other DMA API functions.
Ok, the size issue is still valid and the real reason for doing this patch.
Please apply this:
ieee80211: Use tx_headroom
--- linux-2.6.14-rc4-git2/net/ieee80211/ieee80211_tx.c.orig 2005-10-13 22:45:13.000000000 +0200
+++ linux-2.6.14-rc4-git2/net/ieee80211/ieee80211_tx.c 2005-10-14 01:11:29.000000000 +0200
@@ -207,7 +207,7 @@ void ieee80211_txb_free(struct ieee80211
}
static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size,
- gfp_t gfp_mask)
+ int headroom, gfp_t gfp_mask)
{
struct ieee80211_txb *txb;
int i;
@@ -221,11 +221,13 @@ static struct ieee80211_txb *ieee80211_a
txb->frag_size = txb_size;
for (i = 0; i < nr_frags; i++) {
- txb->fragments[i] = dev_alloc_skb(txb_size);
+ txb->fragments[i] = __dev_alloc_skb(txb_size + headroom,
+ gfp_mask);
if (unlikely(!txb->fragments[i])) {
i--;
break;
}
+ skb_reserve(txb->fragments[i], headroom);
}
if (unlikely(i != nr_frags)) {
while (i >= 0)
@@ -350,7 +352,8 @@ int ieee80211_xmit(struct sk_buff *skb,
/* When we allocate the TXB we allocate enough space for the reserve
* and full fragment bytes (bytes_per_frag doesn't include prefix,
* postfix, header, FCS, etc.) */
- txb = ieee80211_alloc_txb(nr_frags, frag_size, GFP_ATOMIC);
+ txb = ieee80211_alloc_txb(nr_frags, frag_size,
+ ieee->tx_headroom, GFP_ATOMIC);
if (unlikely(!txb)) {
printk(KERN_WARNING "%s: Could not allocate TXB\n",
ieee->dev->name);
Signed-off-by: Michael Buesch <mbuesch@freenet.de>
--
Greetings Michael.
[-- Attachment #1.2: ieee80211_fix_txskb_size.diff --]
[-- Type: text/x-diff, Size: 1471 bytes --]
ieee80211: Use tx_headroom
--- linux-2.6.14-rc4-git2/net/ieee80211/ieee80211_tx.c.orig 2005-10-13 22:45:13.000000000 +0200
+++ linux-2.6.14-rc4-git2/net/ieee80211/ieee80211_tx.c 2005-10-14 01:11:29.000000000 +0200
@@ -207,7 +207,7 @@ void ieee80211_txb_free(struct ieee80211
}
static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size,
- gfp_t gfp_mask)
+ int headroom, gfp_t gfp_mask)
{
struct ieee80211_txb *txb;
int i;
@@ -221,11 +221,13 @@ static struct ieee80211_txb *ieee80211_a
txb->frag_size = txb_size;
for (i = 0; i < nr_frags; i++) {
- txb->fragments[i] = dev_alloc_skb(txb_size);
+ txb->fragments[i] = __dev_alloc_skb(txb_size + headroom,
+ gfp_mask);
if (unlikely(!txb->fragments[i])) {
i--;
break;
}
+ skb_reserve(txb->fragments[i], headroom);
}
if (unlikely(i != nr_frags)) {
while (i >= 0)
@@ -350,7 +352,8 @@ int ieee80211_xmit(struct sk_buff *skb,
/* When we allocate the TXB we allocate enough space for the reserve
* and full fragment bytes (bytes_per_frag doesn't include prefix,
* postfix, header, FCS, etc.) */
- txb = ieee80211_alloc_txb(nr_frags, frag_size, GFP_ATOMIC);
+ txb = ieee80211_alloc_txb(nr_frags, frag_size,
+ ieee->tx_headroom, GFP_ATOMIC);
if (unlikely(!txb)) {
printk(KERN_WARNING "%s: Could not allocate TXB\n",
ieee->dev->name);
Signed-off-by: Michael Buesch <mbuesch@freenet.de>
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2005-10-13 23:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-13 21:41 [PATCH ieee80211] fix TX skb allocation flags and size Michael Buesch
2005-10-13 23:04 ` Jeff Garzik
2005-10-13 23:17 ` Michael Buesch [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=200510140117.21636.mbuesch@freenet.de \
--to=mbuesch@freenet.de \
--cc=bcm43xx-dev@lists.berlios.de \
--cc=ieee80211-devel@lists.sourceforge.net \
--cc=jgarzik@pobox.com \
--cc=jketreno@linux.intel.com \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.