Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/marvell Carefully set IFF_OACTIVE in mvgbe_start(). ...



details:   https://anonhg.NetBSD.org/src/rev/e6c02661d15a
branches:  trunk
changeset: 326564:e6c02661d15a
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Feb 03 05:56:23 2014 +0000

description:
Carefully set IFF_OACTIVE in mvgbe_start(). Even if mvgbe_encap()
returns other than 0, the TX ring might not full. Check whether
the TX ring has one or more packets. If the ring is empty,
dont' set IFF_OACTIVE because an TX complete interrupt never
occur and IFF_OACTIVE flags is left. The interface's timer
isn't reset, so a device timeout desn't occur.

 Fixes a bug that IFF_OACTIVE flag is left on heavy load.
Part of PR#48568.

diffstat:

 sys/dev/marvell/if_mvgbe.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 5c8bbd5a347f -r e6c02661d15a sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c        Mon Feb 03 02:21:52 2014 +0000
+++ b/sys/dev/marvell/if_mvgbe.c        Mon Feb 03 05:56:23 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mvgbe.c,v 1.35 2013/12/23 02:23:25 kiyohara Exp $   */
+/*     $NetBSD: if_mvgbe.c,v 1.36 2014/02/03 05:56:23 msaitoh Exp $    */
 /*
  * Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.35 2013/12/23 02:23:25 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.36 2014/02/03 05:56:23 msaitoh Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -1059,7 +1059,8 @@
                 * for the NIC to drain the ring.
                 */
                if (mvgbe_encap(sc, m_head, &idx)) {
-                       ifp->if_flags |= IFF_OACTIVE;
+                       if (sc->sc_cdata.mvgbe_tx_cnt > 0)
+                               ifp->if_flags |= IFF_OACTIVE;
                        break;
                }
 



Home | Main Index | Thread Index | Old Index