diff options
author | yongari <yongari@FreeBSD.org> | 2010-10-04 21:01:27 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2010-10-04 21:01:27 +0000 |
commit | 8b6b2864aad85b9ff6f9f508f8092ebf8e32850e (patch) | |
tree | 2a1b9fa63f214f3fd80b8fd30a661b0ae7a7a248 | |
parent | e6d97121eaa093c2b3f9ab09c5f2a56ae39b806f (diff) | |
download | FreeBSD-src-8b6b2864aad85b9ff6f9f508f8092ebf8e32850e.zip FreeBSD-src-8b6b2864aad85b9ff6f9f508f8092ebf8e32850e.tar.gz |
Make upper stack know driver's output status. This change increased
TX performance from 221kpps to 231kpps.
-rw-r--r-- | sys/dev/usb/net/if_axe.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c index 5e62f9a..744cb82 100644 --- a/sys/dev/usb/net/if_axe.c +++ b/sys/dev/usb/net/if_axe.c @@ -912,12 +912,15 @@ axe_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - if ((sc->sc_flags & AXE_FLAG_LINK) == 0) { + if ((sc->sc_flags & AXE_FLAG_LINK) == 0 || + (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { /* - * don't send anything if there is no link ! + * Don't send anything if there is no link or + * controller is busy. */ return; } @@ -988,6 +991,7 @@ tr_setup: usbd_xfer_set_frame_len(xfer, 0, pos); usbd_transfer_submit(xfer); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; default: /* Error */ @@ -995,6 +999,7 @@ tr_setup: usbd_errstr(error)); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ @@ -1127,7 +1132,7 @@ axe_stop(struct usb_ether *ue) AXE_LOCK_ASSERT(sc, MA_OWNED); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->sc_flags &= ~AXE_FLAG_LINK; /* |