diff options
author | attilio <attilio@FreeBSD.org> | 2009-05-30 15:14:44 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2009-05-30 15:14:44 +0000 |
commit | b523608331b881784ac18a7dfcb65c7a679130b0 (patch) | |
tree | 073ce0f089e7f642e36b12a238c6d66778db53f5 /sys/dev/firewire | |
parent | d03ca3acc6b07da900f12523e3d2560f84b538c4 (diff) | |
download | FreeBSD-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/firewire')
-rw-r--r-- | sys/dev/firewire/if_fwe.c | 7 | ||||
-rw-r--r-- | sys/dev/firewire/if_fwip.c | 9 |
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index 1c88af8..62616cf 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -105,18 +105,19 @@ TUNABLE_INT("hw.firewire.fwe.rx_queue_len", &rx_queue_len); #ifdef DEVICE_POLLING static poll_handler_t fwe_poll; -static void +static int fwe_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct fwe_softc *fwe; struct firewire_comm *fc; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - return; + return (0); fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe; fc = fwe->fd.fc; fc->poll(fc, (cmd == POLL_AND_CHECK_STATUS)?0:1, count); + return (0); } #endif /* DEVICE_POLLING */ @@ -455,6 +456,7 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* Disable interrupts */ fc->set_intr(fc, 0); ifp->if_capenable |= IFCAP_POLLING; + ifp->if_capenable |= IFCAP_POLLING_NOCOUNT; return (error); } if (!(ifr->ifr_reqcap & IFCAP_POLLING) && @@ -463,6 +465,7 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* Enable interrupts. */ fc->set_intr(fc, 1); ifp->if_capenable &= ~IFCAP_POLLING; + ifp->if_capenable &= ~IFCAP_POLLING_NOCOUNT; return (error); } } diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 90df5a5..66cdb4a 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -112,18 +112,19 @@ TUNABLE_INT("hw.firewire.fwip.rx_queue_len", &rx_queue_len); #ifdef DEVICE_POLLING static poll_handler_t fwip_poll; -static void +static int fwip_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct fwip_softc *fwip; struct firewire_comm *fc; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - return; + return (0); fwip = ((struct fwip_eth_softc *)ifp->if_softc)->fwip; fc = fwip->fd.fc; fc->poll(fc, (cmd == POLL_AND_CHECK_STATUS)?0:1, count); + return (0); } #endif /* DEVICE_POLLING */ @@ -436,7 +437,8 @@ fwip_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) return(error); /* Disable interrupts */ fc->set_intr(fc, 0); - ifp->if_capenable |= IFCAP_POLLING; + ifp->if_capenable |= IFCAP_POLLING | + IFCAP_POLLING_NOCOUNT; return (error); } @@ -446,6 +448,7 @@ fwip_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* Enable interrupts. */ fc->set_intr(fc, 1); ifp->if_capenable &= ~IFCAP_POLLING; + ifp->if_capenable &= ~IFCAP_POLLING_NOCOUNT; return (error); } } |