From 9b4bf5e38b320d06a6bbf9c075a4be9ecb98ba7f Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Fri, 16 Nov 2012 16:36:05 +0800 Subject: [PATCH] polling: Remove device_polling support --- sys/kern/kern_clock.c | 9 --------- sys/net/if.c | 41 ----------------------------------------- sys/net/if_var.h | 35 ++++++++--------------------------- 3 files changed, 8 insertions(+), 77 deletions(-) diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 407ef00670..0027080ee8 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -73,7 +73,6 @@ */ #include "opt_ntp.h" -#include "opt_polling.h" #include "opt_ifpoll.h" #include "opt_pctrack.h" @@ -109,10 +108,6 @@ #include #endif -#ifdef DEVICE_POLLING -extern void init_device_poll_pcpu(int); -#endif - #ifdef IFPOLL_ENABLE extern void ifpoll_init_pcpu(int); #endif @@ -282,10 +277,6 @@ initclocks_pcpu(void) systimer_intr_enable(); -#ifdef DEVICE_POLLING - init_device_poll_pcpu(gd->gd_cpuid); -#endif - #ifdef IFPOLL_ENABLE ifpoll_init_pcpu(gd->gd_cpuid); #endif diff --git a/sys/net/if.c b/sys/net/if.c index 11935a1d48..389846c3a0 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -37,7 +37,6 @@ #include "opt_compat.h" #include "opt_inet6.h" #include "opt_inet.h" -#include "opt_polling.h" #include "opt_ifpoll.h" #include @@ -209,19 +208,6 @@ if_start_cpuid(struct ifnet *ifp) return ifp->if_cpuid; } -#ifdef DEVICE_POLLING -static int -if_start_cpuid_poll(struct ifnet *ifp) -{ - int poll_cpuid = ifp->if_poll_cpuid; - - if (poll_cpuid >= 0) - return poll_cpuid; - else - return ifp->if_cpuid; -} -#endif - #ifdef IFPOLL_ENABLE static int if_start_cpuid_npoll(struct ifnet *ifp) @@ -477,12 +463,6 @@ if_attach(struct ifnet *ifp, lwkt_serialize_t serializer) ifp->if_start_cpuid = if_start_cpuid; ifp->if_cpuid = 0; -#ifdef DEVICE_POLLING - /* Device is not in polling mode by default */ - ifp->if_poll_cpuid = -1; - if (ifp->if_poll != NULL) - ifp->if_start_cpuid = if_start_cpuid_poll; -#endif #ifdef IFPOLL_ENABLE /* Device is not in polling mode by default */ ifp->if_npoll_cpuid = -1; @@ -697,10 +677,6 @@ if_detach(struct ifnet *ifp) * Remove routes and flush queues. */ crit_enter(); -#ifdef DEVICE_POLLING - if (ifp->if_flags & IFF_POLLING) - ether_poll_deregister(ifp); -#endif #ifdef IFPOLL_ENABLE if (ifp->if_flags & IFF_NPOLLING) ifpoll_deregister(ifp); @@ -1505,18 +1481,10 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct ucred *cred) break; case SIOCGIFPOLLCPU: -#ifdef DEVICE_POLLING - ifr->ifr_pollcpu = ifp->if_poll_cpuid; -#else ifr->ifr_pollcpu = -1; -#endif break; case SIOCSIFPOLLCPU: -#ifdef DEVICE_POLLING - if ((ifp->if_flags & IFF_POLLING) == 0) - ether_pollcpu_register(ifp, ifr->ifr_pollcpu); -#endif break; case SIOCSIFFLAGS: @@ -1539,15 +1507,6 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct ucred *cred) crit_exit(); } -#ifdef DEVICE_POLLING - if ((new_flags ^ ifp->if_flags) & IFF_POLLING) { - if (new_flags & IFF_POLLING) { - ether_poll_register(ifp); - } else { - ether_poll_deregister(ifp); - } - } -#endif #ifdef IFPOLL_ENABLE if ((new_flags ^ ifp->if_flags) & IFF_NPOLLING) { if (new_flags & IFF_NPOLLING) diff --git a/sys/net/if_var.h b/sys/net/if_var.h index ab912f8213..2cee6ca8c8 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -123,20 +123,15 @@ struct ifqueue { }; /* - * Note of DEVICE_POLLING - * 1) Any file(*.c) that depends on DEVICE_POLLING supports in this - * file should include opt_polling.h at its beginning. - * 2) When struct changes, which are conditioned by DEVICE_POLLING, + * Note of IFPOLL_ENABLE + * 1) Any file(*.c) that depends on IFPOLL_ENABLE supports in this + * file should include opt_ifpoll.h at its beginning. + * 2) When struct changes, which are conditioned by IFPOLL_ENABLE, * are to be introduced, please keep the struct's size and layout - * same, no matter whether DEVICE_POLLING is defined or not. - * See ifnet.if_poll and ifnet.if_poll_unused for example. + * same, no matter whether IFPOLL_ENABLE is defined or not. + * See ifnet.if_npoll and ifnet.if_npoll_unused for example. */ -#ifdef DEVICE_POLLING -enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS, POLL_DEREGISTER, - POLL_REGISTER }; -#endif - enum ifnet_serialize { IFNET_SERIALIZE_ALL, IFNET_SERIALIZE_MAIN, @@ -237,15 +232,8 @@ struct ifnet { int (*if_start_cpuid) /* cpuid to run if_start */ (struct ifnet *); TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ -#ifdef DEVICE_POLLING - void (*if_poll) /* IFF_POLLING support */ - (struct ifnet *, enum poll_cmd, int); - int if_poll_cpuid; -#else - /* Place holders */ - void (*if_poll_unused)(void); - int if_poll_cpuid_used; -#endif + void (*if_unused1)(void); + int if_unused2; void (*if_serialize) (struct ifnet *, enum ifnet_serialize); void (*if_deserialize) @@ -905,13 +893,6 @@ int if_ring_count2(int cnt, int cnt_max); ((struct sockaddr_dl *)(ifp)->if_lladdr->ifa_addr) #define IF_LLADDR(ifp) LLADDR(IF_LLSOCKADDR(ifp)) -#ifdef DEVICE_POLLING -typedef void poll_handler_t (struct ifnet *ifp, enum poll_cmd cmd, int count); -int ether_poll_register(struct ifnet *); -int ether_poll_deregister(struct ifnet *); -int ether_pollcpu_register(struct ifnet *, int); -#endif /* DEVICE_POLLING */ - #ifdef IFPOLL_ENABLE int ifpoll_register(struct ifnet *); int ifpoll_deregister(struct ifnet *); -- 2.41.0