diff mbox

[net-next,1/6] e1000e: Avoid wrong check on TX hang

Message ID 1322912671-6903-2-git-send-email-jeffrey.t.kirsher@intel.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Kirsher, Jeffrey T Dec. 3, 2011, 11:44 a.m. UTC
From: Michael Wang <wangyun@linux.vnet.ibm.com>

Descriptors may not be write-back while checking TX hang with flag
FLAG2_DMA_BURST on.
So when we detect hang, we just flush the descriptor and detect
again for once.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/e1000.h  |    1 +
 drivers/net/ethernet/intel/e1000e/netdev.c |   23 ++++++++++++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)

Comments

David Miller Dec. 4, 2011, 3:26 a.m. UTC | #1
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Sat,  3 Dec 2011 03:44:26 -0800

> +	if ((!adapter->tx_hang_recheck) &&

Excessive parenthesis, please remove.

> +		adapter->tx_hang_recheck = 1;

This variable is a bool, set it to true or false.

> +			adapter->tx_hang_recheck = 0;

Likewise.

> +	adapter->tx_hang_recheck = 0;

Likewise.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kirsher, Jeffrey T Dec. 4, 2011, 7:28 a.m. UTC | #2
On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Sat,  3 Dec 2011 03:44:26 -0800
> 
> > +	if ((!adapter->tx_hang_recheck) &&
> 
> Excessive parenthesis, please remove.
> 
> > +		adapter->tx_hang_recheck = 1;
> 
> This variable is a bool, set it to true or false.
> 
> > +			adapter->tx_hang_recheck = 0;
> 
> Likewise.
> 
> > +	adapter->tx_hang_recheck = 0;
> 
> Likewise.

Michael/Flavio -

To expedite this patch, I can make the changes that Dave is requesting
and re-submit v2 of the patch, if that is ok with you.

-Jeff
Michael Wang Dec. 5, 2011, 1:05 a.m. UTC | #3
On 12/04/2011 03:28 PM, Jeff Kirsher wrote:

> On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>> Date: Sat,  3 Dec 2011 03:44:26 -0800
>>
>>> +	if ((!adapter->tx_hang_recheck) &&
>>
>> Excessive parenthesis, please remove.
>>
>>> +		adapter->tx_hang_recheck = 1;
>>
>> This variable is a bool, set it to true or false.
>>
>>> +			adapter->tx_hang_recheck = 0;
>>
>> Likewise.
>>
>>> +	adapter->tx_hang_recheck = 0;
>>
>> Likewise.
> 
> Michael/Flavio -
> 
> To expedite this patch, I can make the changes that Dave is requesting
> and re-submit v2 of the patch, if that is ok with you.
> 

Hi, Jeff

That's ok for me, I think it's good if you can work with Dave and make
out a final version for us, if you want my help, please mail me at any
time, I'm glad to work with you.

Flavio:
What's your opinion?

Thanks,
Michael Wang

> -Jeff


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kirsher, Jeffrey T Dec. 5, 2011, 6:25 a.m. UTC | #4
On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
> 
> > On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
> >> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> >> Date: Sat,  3 Dec 2011 03:44:26 -0800
> >>
> >>> +	if ((!adapter->tx_hang_recheck) &&
> >>
> >> Excessive parenthesis, please remove.
> >>
> >>> +		adapter->tx_hang_recheck = 1;
> >>
> >> This variable is a bool, set it to true or false.
> >>
> >>> +			adapter->tx_hang_recheck = 0;
> >>
> >> Likewise.
> >>
> >>> +	adapter->tx_hang_recheck = 0;
> >>
> >> Likewise.
> > 
> > Michael/Flavio -
> > 
> > To expedite this patch, I can make the changes that Dave is requesting
> > and re-submit v2 of the patch, if that is ok with you.
> > 
> 
> Hi, Jeff
> 
> That's ok for me, I think it's good if you can work with Dave and make
> out a final version for us, if you want my help, please mail me at any
> time, I'm glad to work with you.
> 
> Flavio:
> What's your opinion?
> 
> Thanks,
> Michael Wang

I have the patch read to push, so I will go ahead an push v2 out
tonight.  Since I am making changes to your patch, I will be removing
your signed-off-by (and Flavio's) and keep you as a CC: so that you can
verify the changes I have made to resolve the issues that Dave saw.

Cheers,
Jeff
Michael Wang Dec. 5, 2011, 7:15 a.m. UTC | #5
On 12/05/2011 02:25 PM, Jeff Kirsher wrote:

> On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
>> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
>>
>>> On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
>>>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>>>> Date: Sat,  3 Dec 2011 03:44:26 -0800
>>>>
>>>>> +	if ((!adapter->tx_hang_recheck) &&
>>>>
>>>> Excessive parenthesis, please remove.
>>>>
>>>>> +		adapter->tx_hang_recheck = 1;
>>>>
>>>> This variable is a bool, set it to true or false.
>>>>
>>>>> +			adapter->tx_hang_recheck = 0;
>>>>
>>>> Likewise.
>>>>
>>>>> +	adapter->tx_hang_recheck = 0;
>>>>
>>>> Likewise.
>>>
>>> Michael/Flavio -
>>>
>>> To expedite this patch, I can make the changes that Dave is requesting
>>> and re-submit v2 of the patch, if that is ok with you.
>>>
>>
>> Hi, Jeff
>>
>> That's ok for me, I think it's good if you can work with Dave and make
>> out a final version for us, if you want my help, please mail me at any
>> time, I'm glad to work with you.
>>
>> Flavio:
>> What's your opinion?
>>
>> Thanks,
>> Michael Wang
> 
> I have the patch read to push, so I will go ahead an push v2 out
> tonight.  Since I am making changes to your patch, I will be removing
> your signed-off-by (and Flavio's) and keep you as a CC: so that you can
> verify the changes I have made to resolve the issues that Dave saw.
> 

Hi, Jeff

Is that means you have a better patch which different from ours, and you
will use your patch to instead of ours?

Because David is just ask for some small change, I think your time zone
may be better to work with him, so I ask for your help.

I was just confused that why our signed-off-by should be removed?

Thanks,
Michael Wang

> Cheers,
> Jeff


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kirsher, Jeffrey T Dec. 5, 2011, 8:02 a.m. UTC | #6
On Sun, 2011-12-04 at 23:15 -0800, Michael Wang wrote:
> On 12/05/2011 02:25 PM, Jeff Kirsher wrote:
> 
> > On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
> >> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
> >>
> >>> On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
> >>>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> >>>> Date: Sat,  3 Dec 2011 03:44:26 -0800
> >>>>
> >>>>> +	if ((!adapter->tx_hang_recheck) &&
> >>>>
> >>>> Excessive parenthesis, please remove.
> >>>>
> >>>>> +		adapter->tx_hang_recheck = 1;
> >>>>
> >>>> This variable is a bool, set it to true or false.
> >>>>
> >>>>> +			adapter->tx_hang_recheck = 0;
> >>>>
> >>>> Likewise.
> >>>>
> >>>>> +	adapter->tx_hang_recheck = 0;
> >>>>
> >>>> Likewise.
> >>>
> >>> Michael/Flavio -
> >>>
> >>> To expedite this patch, I can make the changes that Dave is requesting
> >>> and re-submit v2 of the patch, if that is ok with you.
> >>>
> >>
> >> Hi, Jeff
> >>
> >> That's ok for me, I think it's good if you can work with Dave and make
> >> out a final version for us, if you want my help, please mail me at any
> >> time, I'm glad to work with you.
> >>
> >> Flavio:
> >> What's your opinion?
> >>
> >> Thanks,
> >> Michael Wang
> > 
> > I have the patch read to push, so I will go ahead an push v2 out
> > tonight.  Since I am making changes to your patch, I will be removing
> > your signed-off-by (and Flavio's) and keep you as a CC: so that you can
> > verify the changes I have made to resolve the issues that Dave saw.
> > 
> 
> Hi, Jeff
> 
> Is that means you have a better patch which different from ours, and you
> will use your patch to instead of ours?
> 
> Because David is just ask for some small change, I think your time zone
> may be better to work with him, so I ask for your help.
> 
> I was just confused that why our signed-off-by should be removed?
> 
> Thanks,
> Michael Wang
> 
> > Cheers,
> > Jeff

It is your patch (your original work) but since I have made changes to
your patch, I (or anyone for that matter) should not assume that you as
the owner would signed off on the changes that I have made based on
feedback.  It would not be right for me to send out a patch with your
signed-off-by which is different from what you originally submitted,
without your ok.  Once I send out the v2 of the patch, please feel free
to add your signed-off-by OR acked-by to the patch.

While I personally do not have a problem keeping you as the owner and
your signed-off-by, I believe that takes in several assumptions which
only you as the owner should speak for.  I am not trying to take
ownership for stats purposes, I care less about the number of patches I
create and own and would rather make sure that the original owners get
the credit due for the work they did.

So with that, when I send out my next series of patches please feel free
to ACK or Sign-off on the changes made.  I just wanted to make sure that
we get these changes in soon (with out delay).

I can wait if you want to keep ownership of the patch, I just wanted to
ensure that we get your patch included as soon as possible based on the
problem it fixes.
Michael Wang Dec. 5, 2011, 8:18 a.m. UTC | #7
On 12/05/2011 04:02 PM, Jeff Kirsher wrote:

> On Sun, 2011-12-04 at 23:15 -0800, Michael Wang wrote:
>> On 12/05/2011 02:25 PM, Jeff Kirsher wrote:
>>
>>> On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
>>>> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
>>>>
>>>>> On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
>>>>>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>>>>>> Date: Sat,  3 Dec 2011 03:44:26 -0800
>>>>>>
>>>>>>> +	if ((!adapter->tx_hang_recheck) &&
>>>>>>
>>>>>> Excessive parenthesis, please remove.
>>>>>>
>>>>>>> +		adapter->tx_hang_recheck = 1;
>>>>>>
>>>>>> This variable is a bool, set it to true or false.
>>>>>>
>>>>>>> +			adapter->tx_hang_recheck = 0;
>>>>>>
>>>>>> Likewise.
>>>>>>
>>>>>>> +	adapter->tx_hang_recheck = 0;
>>>>>>
>>>>>> Likewise.
>>>>>
>>>>> Michael/Flavio -
>>>>>
>>>>> To expedite this patch, I can make the changes that Dave is requesting
>>>>> and re-submit v2 of the patch, if that is ok with you.
>>>>>
>>>>
>>>> Hi, Jeff
>>>>
>>>> That's ok for me, I think it's good if you can work with Dave and make
>>>> out a final version for us, if you want my help, please mail me at any
>>>> time, I'm glad to work with you.
>>>>
>>>> Flavio:
>>>> What's your opinion?
>>>>
>>>> Thanks,
>>>> Michael Wang
>>>
>>> I have the patch read to push, so I will go ahead an push v2 out
>>> tonight.  Since I am making changes to your patch, I will be removing
>>> your signed-off-by (and Flavio's) and keep you as a CC: so that you can
>>> verify the changes I have made to resolve the issues that Dave saw.
>>>
>>
>> Hi, Jeff
>>
>> Is that means you have a better patch which different from ours, and you
>> will use your patch to instead of ours?
>>
>> Because David is just ask for some small change, I think your time zone
>> may be better to work with him, so I ask for your help.
>>
>> I was just confused that why our signed-off-by should be removed?
>>
>> Thanks,
>> Michael Wang
>>
>>> Cheers,
>>> Jeff
> 
> It is your patch (your original work) but since I have made changes to
> your patch, I (or anyone for that matter) should not assume that you as
> the owner would signed off on the changes that I have made based on
> feedback.  It would not be right for me to send out a patch with your
> signed-off-by which is different from what you originally submitted,
> without your ok.  Once I send out the v2 of the patch, please feel free
> to add your signed-off-by OR acked-by to the patch.
> 

Hi, Jeff

That make sense, I'm sorry but because I'm new to the community, and I
just want to make every thing clear so I can do better in the future.

> While I personally do not have a problem keeping you as the owner and
> your signed-off-by, I believe that takes in several assumptions which
> only you as the owner should speak for.  I am not trying to take
> ownership for stats purposes, I care less about the number of patches I
> create and own and would rather make sure that the original owners get
> the credit due for the work they did.
> 


I'm so sorry and I regret if I make you unhappy by some wrong word,
please forgive me.

> So with that, when I send out my next series of patches please feel free
> to ACK or Sign-off on the changes made.  I just wanted to make sure that
> we get these changes in soon (with out delay).
> 
> I can wait if you want to keep ownership of the patch, I just wanted to
> ensure that we get your patch included as soon as possible based on the
> problem it fixes.

Please help us to make the patch perfect, and I'm very glad if I can
have the opportunity to work with you.

Thanks & Best regards
Michael Wang

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kirsher, Jeffrey T Dec. 5, 2011, 8:24 a.m. UTC | #8
On Mon, 2011-12-05 at 00:18 -0800, Michael Wang wrote:
> On 12/05/2011 04:02 PM, Jeff Kirsher wrote:
> 
> > On Sun, 2011-12-04 at 23:15 -0800, Michael Wang wrote:
> >> On 12/05/2011 02:25 PM, Jeff Kirsher wrote:
> >>
> >>> On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
> >>>> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
> >>>>
> >>>>> On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
> >>>>>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> >>>>>> Date: Sat,  3 Dec 2011 03:44:26 -0800
> >>>>>>
> >>>>>>> +	if ((!adapter->tx_hang_recheck) &&
> >>>>>>
> >>>>>> Excessive parenthesis, please remove.
> >>>>>>
> >>>>>>> +		adapter->tx_hang_recheck = 1;
> >>>>>>
> >>>>>> This variable is a bool, set it to true or false.
> >>>>>>
> >>>>>>> +			adapter->tx_hang_recheck = 0;
> >>>>>>
> >>>>>> Likewise.
> >>>>>>
> >>>>>>> +	adapter->tx_hang_recheck = 0;
> >>>>>>
> >>>>>> Likewise.
> >>>>>
> >>>>> Michael/Flavio -
> >>>>>
> >>>>> To expedite this patch, I can make the changes that Dave is requesting
> >>>>> and re-submit v2 of the patch, if that is ok with you.
> >>>>>
> >>>>
> >>>> Hi, Jeff
> >>>>
> >>>> That's ok for me, I think it's good if you can work with Dave and make
> >>>> out a final version for us, if you want my help, please mail me at any
> >>>> time, I'm glad to work with you.
> >>>>
> >>>> Flavio:
> >>>> What's your opinion?
> >>>>
> >>>> Thanks,
> >>>> Michael Wang
> >>>
> >>> I have the patch read to push, so I will go ahead an push v2 out
> >>> tonight.  Since I am making changes to your patch, I will be removing
> >>> your signed-off-by (and Flavio's) and keep you as a CC: so that you can
> >>> verify the changes I have made to resolve the issues that Dave saw.
> >>>
> >>
> >> Hi, Jeff
> >>
> >> Is that means you have a better patch which different from ours, and you
> >> will use your patch to instead of ours?
> >>
> >> Because David is just ask for some small change, I think your time zone
> >> may be better to work with him, so I ask for your help.
> >>
> >> I was just confused that why our signed-off-by should be removed?
> >>
> >> Thanks,
> >> Michael Wang
> >>
> >>> Cheers,
> >>> Jeff
> > 
> > It is your patch (your original work) but since I have made changes to
> > your patch, I (or anyone for that matter) should not assume that you as
> > the owner would signed off on the changes that I have made based on
> > feedback.  It would not be right for me to send out a patch with your
> > signed-off-by which is different from what you originally submitted,
> > without your ok.  Once I send out the v2 of the patch, please feel free
> > to add your signed-off-by OR acked-by to the patch.
> > 
> 
> Hi, Jeff
> 
> That make sense, I'm sorry but because I'm new to the community, and I
> just want to make every thing clear so I can do better in the future.

No problem, just trying to help get your work/fix upstream.
> 
> > While I personally do not have a problem keeping you as the owner and
> > your signed-off-by, I believe that takes in several assumptions which
> > only you as the owner should speak for.  I am not trying to take
> > ownership for stats purposes, I care less about the number of patches I
> > create and own and would rather make sure that the original owners get
> > the credit due for the work they did.
> > 
> 
> 
> I'm so sorry and I regret if I make you unhappy by some wrong word,
> please forgive me.

Not at all, you have not made me unhappy, so no need to apologize.  I am
just sorry if my email came across frustrated or unhappy.

> 
> > So with that, when I send out my next series of patches please feel free
> > to ACK or Sign-off on the changes made.  I just wanted to make sure that
> > we get these changes in soon (with out delay).
> > 
> > I can wait if you want to keep ownership of the patch, I just wanted to
> > ensure that we get your patch included as soon as possible based on the
> > problem it fixes.
> 
> Please help us to make the patch perfect, and I'm very glad if I can
> have the opportunity to work with you.

I am always here to help and welcome any submissions you want to provide
to make our Intel drivers better.  Thank you!

> 
> Thanks & Best regards
> Michael Wang
>
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 9fe18d1..f478a22 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -309,6 +309,7 @@  struct e1000_adapter {
 	u32 txd_cmd;
 
 	bool detect_tx_hung;
+	bool tx_hang_recheck;
 	u8 tx_timeout_factor;
 
 	u32 tx_int_delay;
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c6e9763..3c12e6a 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1014,6 +1014,7 @@  static void e1000_print_hw_hang(struct work_struct *work)
 	struct e1000_adapter *adapter = container_of(work,
 	                                             struct e1000_adapter,
 	                                             print_hang_task);
+	struct net_device *netdev = adapter->netdev;
 	struct e1000_ring *tx_ring = adapter->tx_ring;
 	unsigned int i = tx_ring->next_to_clean;
 	unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
@@ -1025,6 +1026,21 @@  static void e1000_print_hw_hang(struct work_struct *work)
 	if (test_bit(__E1000_DOWN, &adapter->state))
 		return;
 
+	if ((!adapter->tx_hang_recheck) &&
+	    (adapter->flags2 & FLAG2_DMA_BURST)) {
+		/* May be block on write-back, flush and detect again
+		 * flush pending descriptor writebacks to memory
+		 */
+		ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
+		/* execute the writes immediately */
+		e1e_flush();
+		adapter->tx_hang_recheck = 1;
+		return;
+	}
+	/* Real hang detected */
+	adapter->tx_hang_recheck = 0;
+	netif_stop_queue(netdev);
+
 	e1e_rphy(hw, PHY_STATUS, &phy_status);
 	e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
 	e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
@@ -1145,10 +1161,10 @@  static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
 		if (tx_ring->buffer_info[i].time_stamp &&
 		    time_after(jiffies, tx_ring->buffer_info[i].time_stamp
 			       + (adapter->tx_timeout_factor * HZ)) &&
-		    !(er32(STATUS) & E1000_STATUS_TXOFF)) {
+		    !(er32(STATUS) & E1000_STATUS_TXOFF))
 			schedule_work(&adapter->print_hang_task);
-			netif_stop_queue(netdev);
-		}
+		else
+			adapter->tx_hang_recheck = 0;
 	}
 	adapter->total_tx_bytes += total_tx_bytes;
 	adapter->total_tx_packets += total_tx_packets;
@@ -3838,6 +3854,7 @@  static int e1000_open(struct net_device *netdev)
 
 	e1000_irq_enable(adapter);
 
+	adapter->tx_hang_recheck = 0;
 	netif_start_queue(netdev);
 
 	adapter->idle_check = true;