* [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan
@ 2010-05-14 1:25 Jeff Kirsher
2010-05-14 1:25 ` [net-next-2.6 PATCH 2/3] e1000: cleanup unused parameters Jeff Kirsher
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jeff Kirsher @ 2010-05-14 1:25 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jiri Pirko, Jesse Brandeburg, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
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.
CC: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000/e1000_main.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4dd2c23..e9b19f7 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -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 */
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [net-next-2.6 PATCH 2/3] e1000: cleanup unused parameters
2010-05-14 1:25 [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan Jeff Kirsher
@ 2010-05-14 1:25 ` Jeff Kirsher
2010-05-14 10:14 ` David Miller
2010-05-14 1:26 ` [net-next-2.6 PATCH 3/3] ixgb and e1000: Use new function for copybreak tests Jeff Kirsher
2010-05-14 10:14 ` [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2010-05-14 1:25 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Jesse Brandeburg, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
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 <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000/e1000_param.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index 9fbb562..10d8d98 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -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;
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [net-next-2.6 PATCH 3/3] ixgb and e1000: Use new function for copybreak tests
2010-05-14 1:25 [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan Jeff Kirsher
2010-05-14 1:25 ` [net-next-2.6 PATCH 2/3] e1000: cleanup unused parameters Jeff Kirsher
@ 2010-05-14 1:26 ` Jeff Kirsher
2010-05-14 10:14 ` David Miller
2010-05-14 10:14 ` [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2010-05-14 1:26 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Joe Perches, Jeff Kirsher
From: Joe Perches <joe@perches.com>
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.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000/e1000_main.c | 47 +++++++++++++++++++++---------------
drivers/net/ixgb/ixgb_main.c | 52 ++++++++++++++++++++++++----------------
2 files changed, 58 insertions(+), 41 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index e9b19f7..b56eda0 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -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 */
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index d58ca6b..c6b75c8 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1921,6 +1921,31 @@ ixgb_rx_checksum(struct ixgb_adapter *adapter,
}
}
+/*
+ * this should improve performance for small packets with large amounts
+ * of reassembly being done in the stack
+ */
+static void ixgb_check_copybreak(struct net_device *netdev,
+ struct ixgb_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;
+}
+
/**
* ixgb_clean_rx_irq - Send received data up the network stack,
* @adapter: board private structure
@@ -1957,11 +1982,14 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter, int *work_done, int work_to_do)
prefetch(skb->data - NET_IP_ALIGN);
- if (++i == rx_ring->count) i = 0;
+ if (++i == rx_ring->count)
+ i = 0;
next_rxd = IXGB_RX_DESC(*rx_ring, i);
prefetch(next_rxd);
- if ((j = i + 1) == rx_ring->count) j = 0;
+ j = i + 1;
+ if (j == rx_ring->count)
+ j = 0;
next2_buffer = &rx_ring->buffer_info[j];
prefetch(next2_buffer);
@@ -1997,25 +2025,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter, int *work_done, int work_to_do)
goto rxdesc_done;
}
- /* 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;
- }
- }
- /* end copybreak code */
+ ixgb_check_copybreak(netdev, buffer_info, length, &skb);
/* Good Receive */
skb_put(skb, length);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan
2010-05-14 1:25 [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan Jeff Kirsher
2010-05-14 1:25 ` [net-next-2.6 PATCH 2/3] e1000: cleanup unused parameters Jeff Kirsher
2010-05-14 1:26 ` [net-next-2.6 PATCH 3/3] ixgb and e1000: Use new function for copybreak tests Jeff Kirsher
@ 2010-05-14 10:14 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-05-14 10:14 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, jpirko, jesse.brandeburg
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 13 May 2010 18:25:33 -0700
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
>
> 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.
>
> CC: Jiri Pirko <jpirko@redhat.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH 2/3] e1000: cleanup unused parameters
2010-05-14 1:25 ` [net-next-2.6 PATCH 2/3] e1000: cleanup unused parameters Jeff Kirsher
@ 2010-05-14 10:14 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-05-14 10:14 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, jesse.brandeburg
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 13 May 2010 18:25:56 -0700
> From: Jesse Brandeburg <jesse.brandeburg@intel.com>
>
> 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 <jesse.brandeburg@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH 3/3] ixgb and e1000: Use new function for copybreak tests
2010-05-14 1:26 ` [net-next-2.6 PATCH 3/3] ixgb and e1000: Use new function for copybreak tests Jeff Kirsher
@ 2010-05-14 10:14 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-05-14 10:14 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, joe
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 13 May 2010 18:26:17 -0700
> From: Joe Perches <joe@perches.com>
>
> 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.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-05-14 10:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-14 1:25 [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan Jeff Kirsher
2010-05-14 1:25 ` [net-next-2.6 PATCH 2/3] e1000: cleanup unused parameters Jeff Kirsher
2010-05-14 10:14 ` David Miller
2010-05-14 1:26 ` [net-next-2.6 PATCH 3/3] ixgb and e1000: Use new function for copybreak tests Jeff Kirsher
2010-05-14 10:14 ` David Miller
2010-05-14 10:14 ` [net-next-2.6 PATCH 1/3] e1000: fix WARN_ON with mac-vlan David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).