summaryrefslogtreecommitdiffstats
path: root/sys/dev/sf/if_sf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sf/if_sf.c')
-rw-r--r--sys/dev/sf/if_sf.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c
index d03934f..b7f6d36 100644
--- a/sys/dev/sf/if_sf.c
+++ b/sys/dev/sf/if_sf.c
@@ -1334,12 +1334,22 @@ static void sf_start(ifp)
i = SF_IDX_HI(txprod) >> 4;
while(sc->sf_ldata->sf_tx_dlist[i].sf_mbuf == NULL) {
+ if (sc->sf_tx_cnt == (SF_TX_DLIST_CNT - 2)) {
+ ifp->if_flags |= IFF_OACTIVE;
+ cur_tx = NULL;
+ break;
+ }
IF_DEQUEUE(&ifp->if_snd, m_head);
if (m_head == NULL)
break;
cur_tx = &sc->sf_ldata->sf_tx_dlist[i];
- sf_encap(sc, cur_tx, m_head);
+ if (sf_encap(sc, cur_tx, m_head)) {
+ IF_PREPEND(&ifp->if_snd, m_head);
+ ifp->if_flags |= IFF_OACTIVE;
+ cur_tx = NULL;
+ break;
+ }
/*
* If there's a BPF listener, bounce a copy of this frame
@@ -1350,8 +1360,6 @@ static void sf_start(ifp)
SF_INC(i, SF_TX_DLIST_CNT);
sc->sf_tx_cnt++;
- if (sc->sf_tx_cnt == (SF_TX_DLIST_CNT - 2))
- break;
}
if (cur_tx == NULL) {
OpenPOWER on IntegriCloud