e1000: fix WARN_ON with mac-vlan
Subsystems (2)
PATCH 1/3 e1000: fix WARN_ON with mac-vlan
From: Jesse Brandeburg <[email protected]>
When adding more than 14 mac-vlan adapters on e1000 the driver would fire a WARN_ON when adding the 15th. The WARN_ON in this case is completely un-necessary, as the code below the WARN_ON is directly handling the value the WARN_ON triggered on.
---
drivers/net/e1000/e1000_main.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/e1000/e1000_main.c +0 -2
@@ -2161,8 +2161,6 @@ static void e1000_set_rx_mode(struct net_device *netdev)e1000_rar_set (hw, ha->addr, i++); } -WARN_ON (i == rar_entries); -netdev_for_each_mc_addr (ha, netdev) {if (i == rar_entries) {/* load any remaining addresses into the hash table */
PATCH 2/3 e1000: cleanup unused parameters
From: Jesse Brandeburg <[email protected]>
During the cleanup pass after the removal of e1000e hardware from e1000 some parameters were missed. Remove them because it is just dead code.
---
drivers/net/e1000/e1000_param.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
drivers/net/e1000/e1000_param.c +0 -8
@@ -188,14 +188,6 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");*/ E1000_PARAM (SmartPowerDownEnable,"Enable PHY smart power down" ); -/* Enable Kumeran Lock Loss workaround -* -* Valid Range: 0, 1 -* -* Default Value: 1 (enabled) -*/ -E1000_PARAM (KumeranLockLoss,"Enable Kumeran lock loss workaround" ); -struct e1000_option {enum { enable_option, range_option, list_option } type;const char *name;
PATCH 3/3 ixgb and e1000: Use new function for copybreak tests
In reply to Jeff KirsherFrom: Joe Perches <[email protected]>
There appears to be an off-by-1 defect in the maximum packet size copied when copybreak is speified in these modules.
The copybreak module params are specified as:
"Maximum size of packet that is copied to a new buffer on receive"
The tests are changed from "< copybreak" to "<= copybreak" and moved into new static functions for readability.
---
drivers/net/e1000/e1000_main.c | 47 +++++++++++++++++++++--------------- drivers/net/ixgb/ixgb_main.c | 52 ++++++++++++++++++++++++---------------- 2 files changed, 58 insertions(+), 41 deletions(-)
drivers/net/e1000/e1000_main.c +27 -20
@@ -3787,6 +3787,31 @@ next_desc:return cleaned; } +/* +* this should improve performance for small packets with large amounts +* of reassembly being done in the stack +*/ +static void e1000_check_copybreak (struct net_device *netdev, +struct e1000_buffer *buffer_info, +u32 length,struct sk_buff **skb) +{ +struct sk_buff *new_skb; + +if (length > copybreak) +return ; + + new_skb =netdev_alloc_skb_ip_align (netdev, length); +if (!new_skb) +return ; + +skb_copy_to_linear_data_offset (new_skb, -NET_IP_ALIGN , + (*skb)->data -NET_IP_ALIGN , + length +NET_IP_ALIGN ); +/* save the skb in buffer_info as good */ + buffer_info->skb = *skb; + *skb = new_skb; +} +/** * e1000_clean_rx_irq - Send received data up the network stack; legacy * @adapter: board private structure
@@ -3885,26 +3910,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, total_rx_bytes += length; total_rx_packets++; -/* code added for copybreak, this should improve -* performance for small packets with large amounts -* of reassembly being done in the stack */ -if (length < copybreak) { -struct sk_buff *new_skb = -netdev_alloc_skb_ip_align (netdev, length); -if (new_skb) { -skb_copy_to_linear_data_offset (new_skb, - -NET_IP_ALIGN , - (skb->data - -NET_IP_ALIGN ), - (length + -NET_IP_ALIGN )); -/* save the skb in buffer_info as good */ - buffer_info->skb = skb; - skb = new_skb; - } -/* else just continue with the old one */ - } -/* end copybreak code */ +e1000_check_copybreak (netdev, buffer_info, length, &skb); +skb_put (skb, length);/* Receive Checksum Offload */
drivers/net/ixgb/ixgb_main.c +31 -21
73 lines not on this page · raw message
From: Jeff Kirsher <[email protected]>
Date: Thu, 13 May 2010 18:25:33 -0700
Quoted 10 lines
From: Jesse Brandeburg <[email protected]>
When adding more than 14 mac-vlan adapters on e1000 the driver would fire a
WARN_ONwhen adding the 15th. TheWARN_ONin this case is completely un-necessary, as the code below theWARN_ONis directly handling the value theWARN_ONtriggered on.CC Jiri Pirko <[email protected]>Signed-off-by Jesse Brandeburg <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
Re: [net-next-2.6 PATCH 2/3] e1000: cleanup unused parameters
In reply to Jeff KirsherFrom: Jeff Kirsher <[email protected]>
Date: Thu, 13 May 2010 18:25:56 -0700
Quoted 7 lines
From: Jesse Brandeburg <[email protected]>
During the cleanup pass after the removal of e1000e hardware from e1000 some parameters were missed. Remove them because it is just dead code.
Signed-off-by Jesse Brandeburg <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
Re: [net-next-2.6 PATCH 3/3] ixgb and e1000: Use new function for copybreak tests
In reply to Jeff KirsherFrom: Jeff Kirsher <[email protected]>
Date: Thu, 13 May 2010 18:26:17 -0700
Quoted 5 lines
From: Joe Perches <[email protected]>
There appears to be an off-by-1 defect in the maximum packet size copied when copybreak is speified in these modules.
Quoted 8 lines
The copybreak module params are specified as:
"Maximum size of packet that is copied to a new buffer on receive"The tests are changed from "< copybreak" to "<= copybreak" and moved into new static functions for readability.
Signed-off-by Joe Perches <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.