Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic move the code to drop packets in the previous ver...



details:   https://anonhg.NetBSD.org/src/rev/d74f1a989d7f
branches:  trunk
changeset: 574822:d74f1a989d7f
user:      yamt <yamt%NetBSD.org@localhost>
date:      Mon Mar 14 10:08:17 2005 +0000

description:
move the code to drop packets in the previous version
from re_encap to re_start so that other rtk_tx_free checks are
also covered.

diffstat:

 sys/dev/ic/rtl8169.c |  14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diffs (38 lines):

diff -r 7f826b17db17 -r d74f1a989d7f sys/dev/ic/rtl8169.c
--- a/sys/dev/ic/rtl8169.c      Mon Mar 14 08:15:28 2005 +0000
+++ b/sys/dev/ic/rtl8169.c      Mon Mar 14 10:08:17 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl8169.c,v 1.13 2005/03/12 08:01:51 yamt Exp $        */
+/*     $NetBSD: rtl8169.c,v 1.14 2005/03/14 10:08:17 yamt Exp $        */
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -1534,16 +1534,11 @@
                aprint_error("%s: can't map mbuf (error %d)\n",
                    sc->sc_dev.dv_xname, error);
 
-               if (error == EFBIG &&
-                   sc->rtk_ldata.rtk_tx_free == RTK_TX_DESC_CNT) {
-                       return error;
-               }
-
-               return ENOBUFS;
+               return error;
        }
 
        if (map->dm_nsegs > sc->rtk_ldata.rtk_tx_free - 4) {
-               error = ENOBUFS;
+               error = EFBIG;
                goto fail_unload;
        }
        /*
@@ -1656,7 +1651,8 @@
                        break;
 
                error = re_encap(sc, m_head, &idx);
-               if (error == EFBIG) {
+               if (error == EFBIG &&
+                   sc->rtk_ldata.rtk_tx_free == RTK_TX_DESC_CNT) {
                        ifp->if_oerrors++;
                        m_freem(m_head);
                        continue;



Home | Main Index | Thread Index | Old Index