diff options
author | Attilio Rao <attilio@FreeBSD.org> | 2009-05-30 15:14:44 +0000 |
---|---|---|
committer | Attilio Rao <attilio@FreeBSD.org> | 2009-05-30 15:14:44 +0000 |
commit | 1abcdbd127e95ffe08399ec75a7001edd1ca2f5f (patch) | |
tree | 073ce0f089e7f642e36b12a238c6d66778db53f5 /sys/dev/firewire/if_fwip.c | |
parent | d68bbb81fb5d0e122aaf726957d6d93c41af9edc (diff) | |
download | src-1abcdbd127e95ffe08399ec75a7001edd1ca2f5f.tar.gz src-1abcdbd127e95ffe08399ec75a7001edd1ca2f5f.zip |
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
Notes
Notes:
svn path=/head/; revision=193096
Diffstat (limited to 'sys/dev/firewire/if_fwip.c')
-rw-r--r-- | sys/dev/firewire/if_fwip.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 90df5a52c4f8..66cdb4aba11d 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); } } |