aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/e1000/if_lem.c
diff options
context:
space:
mode:
authorJack F Vogel <jfv@FreeBSD.org>2010-06-16 16:37:36 +0000
committerJack F Vogel <jfv@FreeBSD.org>2010-06-16 16:37:36 +0000
commitdfc14ce06eb9937ea8c17aefd8c5007956d68e35 (patch)
tree28c0dd693b59ecb866a52a5559bdd2deb09e5013 /sys/dev/e1000/if_lem.c
parent8fa17b79531406df2d72e22135e79eac753f4f96 (diff)
Changes from John Baldwin adding to last commit,
change rxeof api for poll friendliness, and eliminate unnecessary link tasklet use. Thanks John!
Notes
Notes: svn path=/head/; revision=209238
Diffstat (limited to 'sys/dev/e1000/if_lem.c')
-rw-r--r--sys/dev/e1000/if_lem.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/e1000/if_lem.c b/sys/dev/e1000/if_lem.c
index 8df52894bdaf..c0a53cf372c2 100644
--- a/sys/dev/e1000/if_lem.c
+++ b/sys/dev/e1000/if_lem.c
@@ -200,7 +200,7 @@ static void lem_txeof(struct adapter *);
static void lem_tx_purge(struct adapter *);
static int lem_allocate_receive_structures(struct adapter *);
static int lem_allocate_transmit_structures(struct adapter *);
-static int lem_rxeof(struct adapter *, int);
+static bool lem_rxeof(struct adapter *, int, int *);
#ifndef __NO_STRICT_ALIGNMENT
static int lem_fixup_rx(struct adapter *);
#endif
@@ -1255,7 +1255,7 @@ lem_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
}
EM_CORE_UNLOCK(adapter);
- rx_done = lem_rxeof(adapter, count);
+ lem_rxeof(adapter, count, &rx_done);
EM_TX_LOCK(adapter);
lem_txeof(adapter);
@@ -1308,7 +1308,7 @@ lem_intr(void *arg)
EM_TX_LOCK(adapter);
lem_txeof(adapter);
- lem_rxeof(adapter, -1);
+ lem_rxeof(adapter, -1, NULL);
lem_txeof(adapter);
if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
@@ -1350,7 +1350,7 @@ lem_handle_rxtx(void *context, int pending)
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
- if (lem_rxeof(adapter, adapter->rx_process_limit) != 0)
+ if (lem_rxeof(adapter, adapter->rx_process_limit, NULL) != 0)
taskqueue_enqueue(adapter->tq, &adapter->rxtx_task);
EM_TX_LOCK(adapter);
lem_txeof(adapter);
@@ -3449,8 +3449,8 @@ lem_free_receive_structures(struct adapter *adapter)
*
* For polling we also now return the number of cleaned packets
*********************************************************************/
-static int
-lem_rxeof(struct adapter *adapter, int count)
+static bool
+lem_rxeof(struct adapter *adapter, int count, int *done)
{
struct ifnet *ifp = adapter->ifp;;
struct mbuf *mp;
@@ -3466,8 +3466,10 @@ lem_rxeof(struct adapter *adapter, int count)
BUS_DMASYNC_POSTREAD);
if (!((current_desc->status) & E1000_RXD_STAT_DD)) {
+ if (done != NULL)
+ *done = rx_sent;
EM_RX_UNLOCK(adapter);
- return (rx_sent);
+ return (FALSE);
}
while ((current_desc->status & E1000_RXD_STAT_DD) &&
@@ -3626,8 +3628,10 @@ discard:
if (--i < 0)
i = adapter->num_rx_desc - 1;
E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), i);
+ if (done != NULL)
+ *done = rx_sent;
EM_RX_UNLOCK(adapter);
- return (rx_sent);
+ return (current_desc->status & E1000_RXD_STAT_DD);
}
#ifndef __NO_STRICT_ALIGNMENT