ipwireless: Preallocate received packet buffers with MRU size

Previous thread: ipwireless: Put packets to pool start by Linux Kernel Mailing List on Monday, July 28, 2008 - 9:59 am. (1 message)

Next thread: i2c: Documentation: upgrading clients HOWTO by Linux Kernel Mailing List on Monday, July 28, 2008 - 9:59 am. (1 message)
From: Linux Kernel Mailing List
Date: Monday, July 28, 2008 - 9:59 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a01386...
Commit:     a01386924874c4d6d67f8a34e66f04452c2abb69
Parent:     0f38c47a545d36da4038fec0708e6e3fbdb160b1
Author:     David Sterba <dsterba@suse.cz>
AuthorDate: Mon Jul 28 16:53:32 2008 +0200
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Mon Jul 28 08:28:03 2008 -0700

    ipwireless: Preallocate received packet buffers with MRU size
    
    ipwireless: Preallocate received packet buffers with MRU size
    
    Packets are assembled from link size (~300 bytes) up to PPP MRU
    (1500 by default). Try to preallocate full size rather than
    repeatedly advance buffer size by 256 bytes.
    
    Signed-off-by: David Sterba <dsterba@suse.cz>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 drivers/char/pcmcia/ipwireless/hardware.c |    3 ++-
 drivers/char/pcmcia/ipwireless/network.c  |    5 +++++
 drivers/char/pcmcia/ipwireless/network.h  |    1 +
 3 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c
index d1e69de..7d500f8 100644
--- a/drivers/char/pcmcia/ipwireless/hardware.c
+++ b/drivers/char/pcmcia/ipwireless/hardware.c
@@ -567,7 +567,8 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw,
 			spin_unlock_irqrestore(&hw->lock, flags);
 			list_del(&packet->queue);
 		} else {
-			static int min_capacity = 256;
+			const int min_capacity =
+				ipwireless_ppp_mru(hw->network + 2);
 			int new_capacity;
 
 			spin_unlock_irqrestore(&hw->lock, flags);
diff --git a/drivers/char/pcmcia/ipwireless/network.c b/drivers/char/pcmcia/ipwireless/network.c
index 2b07af0..590762a 100644
--- a/drivers/char/pcmcia/ipwireless/network.c
+++ b/drivers/char/pcmcia/ipwireless/network.c
@@ -499,3 +499,8 @@ int ipwireless_ppp_unit_number(struct ...
Previous thread: ipwireless: Put packets to pool start by Linux Kernel Mailing List on Monday, July 28, 2008 - 9:59 am. (1 message)

Next thread: i2c: Documentation: upgrading clients HOWTO by Linux Kernel Mailing List on Monday, July 28, 2008 - 9:59 am. (1 message)