Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45034
b: refs/heads/master
c: 1f75386
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Brandeburg authored and Jeff Garzik committed Dec 26, 2006
1 parent 0ad1e66 commit 80674bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 018ea44ef1eade417296c4a57afe3cd963268433
refs/heads/master: 1f753861d272e648f3234e4f5fdea9434ae7bee4
19 changes: 15 additions & 4 deletions trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ static void e1000_netpoll (struct net_device *netdev);

extern void e1000_check_options(struct e1000_adapter *adapter);

#define COPYBREAK_DEFAULT 256
static unsigned int copybreak __read_mostly = COPYBREAK_DEFAULT;
module_param(copybreak, uint, 0644);
MODULE_PARM_DESC(copybreak,
"Maximum size of packet that is copied to a new buffer on receive");

static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
pci_channel_state_t state);
static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev);
Expand Down Expand Up @@ -264,7 +270,13 @@ e1000_init_module(void)
printk(KERN_INFO "%s\n", e1000_copyright);

ret = pci_register_driver(&e1000_driver);

if (copybreak != COPYBREAK_DEFAULT) {
if (copybreak == 0)
printk(KERN_INFO "e1000: copybreak disabled\n");
else
printk(KERN_INFO "e1000: copybreak enabled for "
"packets <= %u bytes\n", copybreak);
}
return ret;
}

Expand Down Expand Up @@ -4235,8 +4247,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
/* code added for copybreak, this should improve
* performance for small packets with large amounts
* of reassembly being done in the stack */
#define E1000_CB_LENGTH 256
if (length < E1000_CB_LENGTH) {
if (length < copybreak) {
struct sk_buff *new_skb =
netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
if (new_skb) {
Expand Down Expand Up @@ -4394,7 +4405,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,

/* page alloc/put takes too long and effects small packet
* throughput, so unsplit small packets and save the alloc/put*/
if (l1 && ((length + l1) <= adapter->rx_ps_bsize0)) {
if (l1 && (l1 <= copybreak) && ((length + l1) <= adapter->rx_ps_bsize0)) {
u8 *vaddr;
/* there is no documentation about how to call
* kmap_atomic, so we can't hold the mapping
Expand Down

0 comments on commit 80674bf

Please sign in to comment.