summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2003-04-08 01:05:54 +0000
committersilby <silby@FreeBSD.org>2003-04-08 01:05:54 +0000
commita725b928c5cfd74f95504027295468428dbebc13 (patch)
tree0327dcae3e22d9af71ec18da85be7d7b8c90e9fe /sys/pci
parent6ed7a15ac72097ecdbb4c644af0f11dc28b3d663 (diff)
downloadFreeBSD-src-a725b928c5cfd74f95504027295468428dbebc13.zip
FreeBSD-src-a725b928c5cfd74f95504027295468428dbebc13.tar.gz
Fix up callers of xl_encap so that they handle a failure response
properly (likely due to mbuf exhaustion.) Previously, the driver got somewhat wedged. Also, remove the annoying messages printed every time xl_encap couldn't allocate a mbuf; they served no useful purpose, and just made an mbuf exhaustion situation more annoying. MFC after: 1 week
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_xl.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index 38583ca..fdb4d0b 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -2452,7 +2452,6 @@ xl_encap(sc, c, m_head)
m_new = m_defrag(m_head, M_DONTWAIT);
if (m_new == NULL) {
m_freem(m_head);
- printf("xl%d: no memory for tx list\n", sc->xl_unit);
return(1);
} else {
m_head = m_new;
@@ -2500,6 +2499,7 @@ xl_start(ifp)
struct xl_softc *sc;
struct mbuf *m_head = NULL;
struct xl_chain *prev = NULL, *cur_tx = NULL, *start_tx;
+ struct xl_chain *prev_tx;
u_int32_t status;
int error;
@@ -2527,12 +2527,15 @@ xl_start(ifp)
break;
/* Pick a descriptor off the free list. */
+ prev_tx = cur_tx;
cur_tx = sc->xl_cdata.xl_tx_free;
/* Pack the data into the descriptor. */
error = xl_encap(sc, cur_tx, m_head);
- if (error)
+ if (error) {
+ cur_tx = prev_tx;
continue;
+ }
sc->xl_cdata.xl_tx_free = cur_tx->xl_next;
cur_tx->xl_next = NULL;
@@ -2631,6 +2634,7 @@ xl_start_90xB(ifp)
struct xl_softc *sc;
struct mbuf *m_head = NULL;
struct xl_chain *prev = NULL, *cur_tx = NULL, *start_tx;
+ struct xl_chain *prev_tx;
int error, idx;
sc = ifp->if_softc;
@@ -2655,12 +2659,15 @@ xl_start_90xB(ifp)
if (m_head == NULL)
break;
+ prev_tx = cur_tx;
cur_tx = &sc->xl_cdata.xl_tx_chain[idx];
/* Pack the data into the descriptor. */
error = xl_encap(sc, cur_tx, m_head);
- if (error)
+ if (error) {
+ cur_tx = prev_tx;
continue;
+ }
/* Chain it together. */
if (prev != NULL)
OpenPOWER on IntegriCloud