summaryrefslogtreecommitdiffstats
path: root/sys/dev/vge
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2009-05-30 15:14:44 +0000
committerattilio <attilio@FreeBSD.org>2009-05-30 15:14:44 +0000
commitb523608331b881784ac18a7dfcb65c7a679130b0 (patch)
tree073ce0f089e7f642e36b12a238c6d66778db53f5 /sys/dev/vge
parentd03ca3acc6b07da900f12523e3d2560f84b538c4 (diff)
downloadFreeBSD-src-b523608331b881784ac18a7dfcb65c7a679130b0.zip
FreeBSD-src-b523608331b881784ac18a7dfcb65c7a679130b0.tar.gz
When user_frac in the polling subsystem is low it is going to busy the
CPU for too long period than necessary. Additively, interfaces are kept polled (in the tick) even if no more packets are available. In order to avoid such situations a new generic mechanism can be implemented in proactive way, keeping track of the time spent on any packet and fragmenting the time for any tick, stopping the processing as soon as possible. In order to implement such mechanism, the polling handler needs to change, returning the number of packets processed. While the intended logic is not part of this patch, the polling KPI is broken by this commit, adding an int return value and the new flag IFCAP_POLLING_NOCOUNT (which will signal that the return value is meaningless for the installed handler and checking should be skipped). Bump __FreeBSD_version in order to signal such situation. Reviewed by: emaste Sponsored by: Sandvine Incorporated
Diffstat (limited to 'sys/dev/vge')
-rw-r--r--sys/dev/vge/if_vge.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c
index 5a56eb1..b9eaeaa 100644
--- a/sys/dev/vge/if_vge.c
+++ b/sys/dev/vge/if_vge.c
@@ -156,7 +156,7 @@ static int vge_tx_list_init (struct vge_softc *);
static __inline void vge_fixup_rx
(struct mbuf *);
#endif
-static void vge_rxeof (struct vge_softc *);
+static int vge_rxeof (struct vge_softc *);
static void vge_txeof (struct vge_softc *);
static void vge_intr (void *);
static void vge_tick (void *);
@@ -1295,7 +1295,7 @@ vge_fixup_rx(m)
* RX handler. We support the reception of jumbo frames that have
* been fragmented across multiple 2K mbuf cluster buffers.
*/
-static void
+static int
vge_rxeof(sc)
struct vge_softc *sc;
{
@@ -1482,7 +1482,7 @@ vge_rxeof(sc)
CSR_WRITE_2(sc, VGE_RXDESC_RESIDUECNT, lim);
- return;
+ return (lim);
}
static void
@@ -1582,17 +1582,18 @@ vge_tick(xsc)
}
#ifdef DEVICE_POLLING
-static void
+static int
vge_poll (struct ifnet *ifp, enum poll_cmd cmd, int count)
{
struct vge_softc *sc = ifp->if_softc;
+ int rx_npkts = 0;
VGE_LOCK(sc);
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
goto done;
sc->rxcycles = count;
- vge_rxeof(sc);
+ rx_npkts = vge_rxeof(sc);
vge_txeof(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
@@ -1623,6 +1624,7 @@ vge_poll (struct ifnet *ifp, enum poll_cmd cmd, int count)
}
done:
VGE_UNLOCK(sc);
+ return (rx_npkts);
}
#endif /* DEVICE_POLLING */
OpenPOWER on IntegriCloud