mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: torvalds@linux-foundation.org
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	jkosina@suse.cz, dsterba@suse.cz
Subject: [PATCH 12/12] ipwireless: Preallocate received packet buffers with MRU size
Date: Mon, 28 Jul 2008 16:53:32 +0200	[thread overview]
Message-ID: <20080728145332.13378.80871.stgit@ds.suse.cz> (raw)
In-Reply-To: <20080728145124.13378.39300.stgit@ds.suse.cz>

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>
---

 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 ipw_network *network)
 
 	return ret;
 }
+
+int ipwireless_ppp_mru(const struct ipw_network *network)
+{
+	return network->mru;
+}
diff --git a/drivers/char/pcmcia/ipwireless/network.h b/drivers/char/pcmcia/ipwireless/network.h
index ccacd26..561f765 100644
--- a/drivers/char/pcmcia/ipwireless/network.h
+++ b/drivers/char/pcmcia/ipwireless/network.h
@@ -48,5 +48,6 @@ void ipwireless_ppp_open(struct ipw_network *net);
 void ipwireless_ppp_close(struct ipw_network *net);
 int ipwireless_ppp_channel_index(struct ipw_network *net);
 int ipwireless_ppp_unit_number(struct ipw_network *net);
+int ipwireless_ppp_mru(const struct ipw_network *net);
 
 #endif


  parent reply	other threads:[~2008-07-28 14:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-28 14:52 [RESEND][PATCH 00/12] ipwireless: driver updates David Sterba
2008-07-28 14:52 ` [PATCH 01/12] ipwireless: Misc cleanups David Sterba
2008-07-28 14:52 ` [PATCH 02/12] ipwireless: Remove unused defines David Sterba
2008-07-28 14:52 ` [PATCH 03/12] ipwireless: Rename spinlock variables to lock David Sterba
2008-07-28 14:52 ` [PATCH 04/12] ipwireless: Remove pt_regs from interrupt handler David Sterba
2008-07-28 14:52 ` [PATCH 05/12] ipwireless: Glue splitted printk strings back David Sterba
2008-07-28 14:53 ` [PATCH 06/12] ipwireless: Remove endian-dependent bitfields David Sterba
2008-07-28 16:41   ` Petr Tesarik
2008-07-28 14:53 ` [PATCH 07/12] ipwireless: Do not return value from sending funcs David Sterba
2008-07-28 14:53 ` [PATCH 08/12] ipwireless: Constify buffer variables David Sterba
2008-07-28 14:53 ` [PATCH 09/12] ipwireless: Explicitly request io and mem regions David Sterba
2008-07-28 14:53 ` [PATCH 10/12] ipwireless: Increase PPP outgoing queue size David Sterba
2008-07-28 14:53 ` [PATCH 11/12] ipwireless: Put packets to pool start David Sterba
2008-07-28 14:53 ` David Sterba [this message]
2008-07-28 16:42 ` [RESEND][PATCH 00/12] ipwireless: driver updates Stefan Schmidt
  -- strict thread matches above, loose matches on Subject: below --
2008-07-18 22:10 [PATCH " David Sterba
2008-07-18 22:11 ` [PATCH 12/12] ipwireless: Preallocate received packet buffers with MRU size David Sterba

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=20080728145332.13378.80871.stgit@ds.suse.cz \
    --to=dsterba@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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

Powered by JetHome