diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2006-12-15 04:40:39 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-26 15:51:30 -0500 |
commit | 1f753861d272e648f3234e4f5fdea9434ae7bee4 (patch) | |
tree | ae34cd182d14e4f736a2acac3079b16f0d47a67b /drivers/net/e1000/e1000_main.c | |
parent | 018ea44ef1eade417296c4a57afe3cd963268433 (diff) |
[PATCH] e1000: Make the copybreak value a module parameter
Allow the user to vary the size that copybreak works. Currently cb is enabled
for packets < 256 bytes, but various tests indicate that this should be
configurable for specific use cases. In addition, this parameter allows us
to force never/always during testing to get full and predictable coverage of
both code paths.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 6c3618d55d15..3f40a902de64 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -213,6 +213,12 @@ static void e1000_netpoll (struct net_device *netdev); | |||
213 | 213 | ||
214 | extern void e1000_check_options(struct e1000_adapter *adapter); | 214 | extern void e1000_check_options(struct e1000_adapter *adapter); |
215 | 215 | ||
216 | #define COPYBREAK_DEFAULT 256 | ||
217 | static unsigned int copybreak __read_mostly = COPYBREAK_DEFAULT; | ||
218 | module_param(copybreak, uint, 0644); | ||
219 | MODULE_PARM_DESC(copybreak, | ||
220 | "Maximum size of packet that is copied to a new buffer on receive"); | ||
221 | |||
216 | static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, | 222 | static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, |
217 | pci_channel_state_t state); | 223 | pci_channel_state_t state); |
218 | static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev); | 224 | static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev); |
@@ -264,7 +270,13 @@ e1000_init_module(void) | |||
264 | printk(KERN_INFO "%s\n", e1000_copyright); | 270 | printk(KERN_INFO "%s\n", e1000_copyright); |
265 | 271 | ||
266 | ret = pci_register_driver(&e1000_driver); | 272 | ret = pci_register_driver(&e1000_driver); |
267 | 273 | if (copybreak != COPYBREAK_DEFAULT) { | |
274 | if (copybreak == 0) | ||
275 | printk(KERN_INFO "e1000: copybreak disabled\n"); | ||
276 | else | ||
277 | printk(KERN_INFO "e1000: copybreak enabled for " | ||
278 | "packets <= %u bytes\n", copybreak); | ||
279 | } | ||
268 | return ret; | 280 | return ret; |
269 | } | 281 | } |
270 | 282 | ||
@@ -4235,8 +4247,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
4235 | /* code added for copybreak, this should improve | 4247 | /* code added for copybreak, this should improve |
4236 | * performance for small packets with large amounts | 4248 | * performance for small packets with large amounts |
4237 | * of reassembly being done in the stack */ | 4249 | * of reassembly being done in the stack */ |
4238 | #define E1000_CB_LENGTH 256 | 4250 | if (length < copybreak) { |
4239 | if (length < E1000_CB_LENGTH) { | ||
4240 | struct sk_buff *new_skb = | 4251 | struct sk_buff *new_skb = |
4241 | netdev_alloc_skb(netdev, length + NET_IP_ALIGN); | 4252 | netdev_alloc_skb(netdev, length + NET_IP_ALIGN); |
4242 | if (new_skb) { | 4253 | if (new_skb) { |
@@ -4394,7 +4405,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
4394 | 4405 | ||
4395 | /* page alloc/put takes too long and effects small packet | 4406 | /* page alloc/put takes too long and effects small packet |
4396 | * throughput, so unsplit small packets and save the alloc/put*/ | 4407 | * throughput, so unsplit small packets and save the alloc/put*/ |
4397 | if (l1 && ((length + l1) <= adapter->rx_ps_bsize0)) { | 4408 | if (l1 && (l1 <= copybreak) && ((length + l1) <= adapter->rx_ps_bsize0)) { |
4398 | u8 *vaddr; | 4409 | u8 *vaddr; |
4399 | /* there is no documentation about how to call | 4410 | /* there is no documentation about how to call |
4400 | * kmap_atomic, so we can't hold the mapping | 4411 | * kmap_atomic, so we can't hold the mapping |