diff options
Diffstat (limited to 'sys/dev/e1000/if_em.c')
-rw-r--r-- | sys/dev/e1000/if_em.c | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index ff39558..6b6b791 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -219,15 +219,15 @@ static int em_detach(device_t); static int em_shutdown(device_t); static int em_suspend(device_t); static int em_resume(device_t); -#ifdef EM_MULTIQUEUE + static int em_mq_start(struct ifnet *, struct mbuf *); static int em_mq_start_locked(struct ifnet *, struct tx_ring *); static void em_qflush(struct ifnet *); -#else + static void em_start(struct ifnet *); static void em_start_locked(struct ifnet *, struct tx_ring *); -#endif + static int em_ioctl(struct ifnet *, u_long, caddr_t); static void em_init(void *); static void em_init_locked(struct adapter *); @@ -950,13 +950,13 @@ em_resume(device_t dev) (ifp->if_drv_flags & IFF_DRV_RUNNING) && adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); -#ifdef EM_MULTIQUEUE + if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr); -#else + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) em_start_locked(ifp, txr); -#endif + EM_TX_UNLOCK(txr); } } @@ -966,7 +966,7 @@ em_resume(device_t dev) } -#ifndef EM_MULTIQUEUE + static void em_start_locked(struct ifnet *ifp, struct tx_ring *txr) { @@ -1029,7 +1029,7 @@ em_start(struct ifnet *ifp) } return; } -#else /* EM_MULTIQUEUE */ + /********************************************************************* * Multiqueue Transmit routines * @@ -1136,7 +1136,7 @@ em_qflush(struct ifnet *ifp) } if_qflush(ifp); } -#endif /* EM_MULTIQUEUE */ + /********************************************************************* * Ioctl entry point @@ -1539,13 +1539,13 @@ em_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) EM_TX_LOCK(txr); em_txeof(txr); -#ifdef EM_MULTIQUEUE + if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr); -#else + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) em_start_locked(ifp, txr); -#endif + EM_TX_UNLOCK(txr); return (rx_done); @@ -1613,13 +1613,13 @@ em_handle_que(void *context, int pending) EM_TX_LOCK(txr); em_txeof(txr); -#ifdef EM_MULTIQUEUE + if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr); -#else + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) em_start_locked(ifp, txr); -#endif + EM_TX_UNLOCK(txr); if (more) { taskqueue_enqueue(adapter->tq, &adapter->que_task); @@ -1647,13 +1647,13 @@ em_msix_tx(void *arg) ++txr->tx_irq; EM_TX_LOCK(txr); em_txeof(txr); -#ifdef EM_MULTIQUEUE + if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr); -#else + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) em_start_locked(ifp, txr); -#endif + /* Reenable this interrupt */ E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims); @@ -1748,13 +1748,13 @@ em_handle_tx(void *context, int pending) EM_TX_LOCK(txr); em_txeof(txr); -#ifdef EM_MULTIQUEUE + if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr); -#else + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) em_start_locked(ifp, txr); -#endif + E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims); EM_TX_UNLOCK(txr); } @@ -1778,13 +1778,13 @@ em_handle_link(void *context, int pending) if (adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); -#ifdef EM_MULTIQUEUE + if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr); -#else + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) em_start_locked(ifp, txr); -#endif + EM_TX_UNLOCK(txr); } } @@ -3251,16 +3251,15 @@ em_setup_interface(device_t dev, struct adapter *adapter) ifp->if_hw_tsomaxsegcount = EM_MAX_SCATTER - 5; ifp->if_hw_tsomaxsegsize = EM_TSO_SEG_SIZE; -#ifdef EM_MULTIQUEUE /* Multiqueue stack interface */ ifp->if_transmit = em_mq_start; ifp->if_qflush = em_qflush; -#else + ifp->if_start = em_start; IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 1); ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 1; IFQ_SET_READY(&ifp->if_snd); -#endif + ether_ifattach(ifp, adapter->hw.mac.addr); |