From owner-svn-src-all@FreeBSD.ORG Thu Sep 10 18:53:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5C4C106566C; Thu, 10 Sep 2009 18:53:34 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B52808FC08; Thu, 10 Sep 2009 18:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8AIrYnE028059; Thu, 10 Sep 2009 18:53:34 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8AIrYpb028056; Thu, 10 Sep 2009 18:53:34 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200909101853.n8AIrYpb028056@svn.freebsd.org> From: Jack F Vogel Date: Thu, 10 Sep 2009 18:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197073 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2009 18:53:34 -0000 Author: jfv Date: Thu Sep 10 18:53:34 2009 New Revision: 197073 URL: http://svn.freebsd.org/changeset/base/197073 Log: Fix for pr 138516 An mbuf is not requeued when a xmit fails. MFC: 3 days Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Sep 10 18:33:08 2009 (r197072) +++ head/sys/dev/e1000/if_em.c Thu Sep 10 18:53:34 2009 (r197073) @@ -1034,9 +1034,10 @@ em_mq_start_locked(struct ifnet *ifp, st return (error); } else if (drbr_empty(ifp, adapter->br) && (adapter->num_tx_desc_avail > EM_TX_OP_THRESHOLD)) { - if (em_xmit(adapter, &m)) { - if (m && (error = drbr_enqueue(ifp, adapter->br, m)) != 0) - return (error); + if (error = em_xmit(adapter, &m)) { + if (m != NULL) + error = drbr_enqueue(ifp, adapter->br, m); + return (error); } else { /* * We've bypassed the buf ring so we need to update @@ -1063,8 +1064,12 @@ process: next = drbr_dequeue(ifp, adapter->br); if (next == NULL) break; - if (em_xmit(adapter, &next)) + if (error = em_xmit(adapter, &next)) { + if (next != NULL) + error = drbr_enqueue(ifp, adapter->br, next); break; + } + drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); ETHER_BPF_MTAP(ifp, next); /* Set the watchdog */ adapter->watchdog_timer = EM_TX_TIMEOUT; @@ -1073,7 +1078,7 @@ process: if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD) ifp->if_drv_flags |= IFF_DRV_OACTIVE; - return (0); + return (error); } /*