[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] DomU's network interface will hung when Dom0 running 32bit




On 2013-10-16 23:04, jianhai luan wrote:

 From ef02403a10173896c5c102f768741d0700b8a3a2 Mon Sep 17 00:00:00 2001
From: Jason Luan<jianhai.luan@xxxxxxxxxx>
Date: Tue, 15 Oct 2013 17:07:49 +0800
Subject: [PATCH] xen-netback: pending timer only in the range [expire,
  next_credit)

The function time_after_eq() do correct judge in range of MAX_UNLONG/2.
If net-front send lesser package, the delta between now and next_credit
will out of the range and time_after_eq() will do wrong judge in result
to net-front hung.  For example:
     expire    next_credit    ....    next_credit+MAX_UNLONG/2    now
     -----------------time increases this direction----------------->

We should be add the environment which now beyond next_credit+MAX_UNLONG/2.
Because the fact now mustn't before expire, time_before(now, expire) == true
will show the environment.
     time_after_eq(now, next_credit) || time_before (now, expire)
     ==
     !time_in_range_open(now, expire, next_credit)

Signed-off-by: Jason Luan<jianhai.luan@xxxxxxxxxx>
---
  drivers/net/xen-netback/netback.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/xen-netback/netback.c 
b/drivers/net/xen-netback/netback.c
index f3e591c..62492f0 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1195,7 +1195,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, 
unsigned size)
                return true;
/* Passed the point where we can replenish credit? */

I think the comments above can be removed, and it is better to explain the if condition here briefly.

Thanks
Annie

-       if (time_after_eq(now, next_credit)) {
+       if (!time_in_range(now, vif->credit_timeout.expires, next_credit)) {
                vif->credit_timeout.expires = now;
                tx_add_credit(vif);
        }


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.