summaryrefslogtreecommitdiffstats
path: root/sys/dev/lmc/if_lmc.c
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/lmc/if_lmc.c
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/lmc/if_lmc.c')
-rw-r--r--sys/dev/lmc/if_lmc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/lmc/if_lmc.c b/sys/dev/lmc/if_lmc.c
index c97bdfa..1df51ad 100644
--- a/sys/dev/lmc/if_lmc.c
+++ b/sys/dev/lmc/if_lmc.c
@@ -3960,7 +3960,7 @@ user_interrupt(softc_t *sc, int check_status)
# if (defined(__FreeBSD__) && defined(DEVICE_POLLING))
/* Service the card from the kernel idle loop without interrupts. */
-static void
+static int
fbsd_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
{
softc_t *sc = IFP2SC(ifp);
@@ -4828,6 +4828,7 @@ setup_ifnet(struct ifnet *ifp)
# if (defined(__FreeBSD__) && defined(DEVICE_POLLING))
ifp->if_capabilities |= IFCAP_POLLING;
+ ifp->if_capenable |= IFCAP_POLLING_NOCOUNT;
# if (__FreeBSD_version < 500000)
ifp->if_capenable |= IFCAP_POLLING;
# endif
OpenPOWER on IntegriCloud