Commit a0138692 authored by David Sterba's avatar David Sterba Committed by Linus Torvalds

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: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0f38c47a
...@@ -567,7 +567,8 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw, ...@@ -567,7 +567,8 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw,
spin_unlock_irqrestore(&hw->lock, flags); spin_unlock_irqrestore(&hw->lock, flags);
list_del(&packet->queue); list_del(&packet->queue);
} else { } else {
static int min_capacity = 256; const int min_capacity =
ipwireless_ppp_mru(hw->network + 2);
int new_capacity; int new_capacity;
spin_unlock_irqrestore(&hw->lock, flags); spin_unlock_irqrestore(&hw->lock, flags);
......
...@@ -499,3 +499,8 @@ int ipwireless_ppp_unit_number(struct ipw_network *network) ...@@ -499,3 +499,8 @@ int ipwireless_ppp_unit_number(struct ipw_network *network)
return ret; return ret;
} }
int ipwireless_ppp_mru(const struct ipw_network *network)
{
return network->mru;
}
...@@ -48,5 +48,6 @@ void ipwireless_ppp_open(struct ipw_network *net); ...@@ -48,5 +48,6 @@ void ipwireless_ppp_open(struct ipw_network *net);
void ipwireless_ppp_close(struct ipw_network *net); void ipwireless_ppp_close(struct ipw_network *net);
int ipwireless_ppp_channel_index(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_unit_number(struct ipw_network *net);
int ipwireless_ppp_mru(const struct ipw_network *net);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment