From: Sepherosa Ziehau Date: Fri, 12 Oct 2012 02:46:27 +0000 (+0800) Subject: ifpoll: Don't pass pollhz to status poll handler X-Git-Tag: v3.4.0rc~994^2~26 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/2f00683bb126e1a3c243ec03274b540b58baa673 ifpoll: Don't pass pollhz to status poll handler It is not useful at all. --- diff --git a/sys/dev/netif/emx/if_emx.c b/sys/dev/netif/emx/if_emx.c index efb709bcb1..8131b33e35 100644 --- a/sys/dev/netif/emx/if_emx.c +++ b/sys/dev/netif/emx/if_emx.c @@ -179,6 +179,9 @@ static int emx_ioctl(struct ifnet *, u_long, caddr_t, struct ucred *); static void emx_start(struct ifnet *); #ifdef IFPOLL_ENABLE static void emx_npoll(struct ifnet *, struct ifpoll_info *); +static void emx_npoll_status(struct ifnet *); +static void emx_npoll_tx(struct ifnet *, void *, int); +static void emx_npoll_rx(struct ifnet *, void *, int); #endif static void emx_watchdog(struct ifnet *); static void emx_media_status(struct ifnet *, struct ifmediareq *); @@ -3721,7 +3724,7 @@ emx_serialize_assert(struct ifnet *ifp, enum ifnet_serialize slz, #ifdef IFPOLL_ENABLE static void -emx_npoll_status(struct ifnet *ifp, int pollhz __unused) +emx_npoll_status(struct ifnet *ifp) { struct emx_softc *sc = ifp->if_softc; uint32_t reg_icr; diff --git a/sys/dev/netif/igb/if_igb.c b/sys/dev/netif/igb/if_igb.c index fe9af3db2d..b7f50536e1 100644 --- a/sys/dev/netif/igb/if_igb.c +++ b/sys/dev/netif/igb/if_igb.c @@ -186,7 +186,7 @@ static void igb_start(struct ifnet *); static void igb_npoll(struct ifnet *, struct ifpoll_info *); static void igb_npoll_rx(struct ifnet *, void *, int); static void igb_npoll_tx(struct ifnet *, void *, int); -static void igb_npoll_status(struct ifnet *, int); +static void igb_npoll_status(struct ifnet *); #endif static void igb_serialize(struct ifnet *, enum ifnet_serialize); static void igb_deserialize(struct ifnet *, enum ifnet_serialize); @@ -2920,7 +2920,7 @@ igb_update_vf_stats_counters(struct igb_softc *sc) #ifdef IFPOLL_ENABLE static void -igb_npoll_status(struct ifnet *ifp, int pollhz __unused) +igb_npoll_status(struct ifnet *ifp) { struct igb_softc *sc = ifp->if_softc; uint32_t reg_icr; diff --git a/sys/dev/netif/jme/if_jme.c b/sys/dev/netif/jme/if_jme.c index bb118b84fb..9855f9f1f8 100644 --- a/sys/dev/netif/jme/if_jme.c +++ b/sys/dev/netif/jme/if_jme.c @@ -108,7 +108,7 @@ static void jme_mediastatus(struct ifnet *, struct ifmediareq *); static int jme_mediachange(struct ifnet *); #ifdef IFPOLL_ENABLE static void jme_npoll(struct ifnet *, struct ifpoll_info *); -static void jme_npoll_status(struct ifnet *, int); +static void jme_npoll_status(struct ifnet *); static void jme_npoll_rx(struct ifnet *, void *, int); static void jme_npoll_tx(struct ifnet *, void *, int); #endif @@ -3297,7 +3297,7 @@ jme_set_rx_coal(struct jme_softc *sc) #ifdef IFPOLL_ENABLE static void -jme_npoll_status(struct ifnet *ifp, int pollhz __unused) +jme_npoll_status(struct ifnet *ifp) { struct jme_softc *sc = ifp->if_softc; uint32_t status; diff --git a/sys/net/if_poll.c b/sys/net/if_poll.c index 21d13b48b8..05981ec1a1 100644 --- a/sys/net/if_poll.c +++ b/sys/net/if_poll.c @@ -186,8 +186,6 @@ struct stpoll_rec { struct stpoll_ctx { struct netmsg_base poll_netmsg; - int pollhz; - uint32_t poll_handlers; /* next free entry in pr[]. */ struct stpoll_rec pr[IFPOLL_LIST_LEN]; @@ -488,8 +486,6 @@ stpoll_init(void) struct stpoll_ctx *st_ctx = &stpoll_context; const struct poll_comm *comm = poll_common[0]; - st_ctx->pollhz = comm->pollhz / (comm->poll_stfrac + 1); - sysctl_ctx_init(&st_ctx->poll_sysctl_ctx); st_ctx->poll_sysctl_tree = SYSCTL_ADD_NODE(&st_ctx->poll_sysctl_ctx, SYSCTL_CHILDREN(comm->sysctl_tree), @@ -537,7 +533,7 @@ stpoll_handler(netmsg_t msg) if ((ifp->if_flags & (IFF_RUNNING | IFF_NPOLLING)) == (IFF_RUNNING | IFF_NPOLLING)) - rec->status_func(ifp, st_ctx->pollhz); + rec->status_func(ifp); lwkt_serialize_exit(rec->serializer); } @@ -1387,8 +1383,6 @@ sysctl_pollhz_handler(netmsg_t nmsg) rxpoll_context[mycpuid]->pollhz = comm->pollhz; txpoll_context[mycpuid]->pollhz = comm->pollhz / (comm->poll_txfrac + 1); - if (mycpuid == 0) - stpoll_context.pollhz = comm->pollhz / (comm->poll_stfrac + 1); /* * Adjust polling frequency diff --git a/sys/net/if_poll.h b/sys/net/if_poll.h index 9d0417b286..87898b6be2 100644 --- a/sys/net/if_poll.h +++ b/sys/net/if_poll.h @@ -7,7 +7,7 @@ struct lwkt_serialize; struct ifnet; typedef void (*ifpoll_iofn_t)(struct ifnet *, void *, int); -typedef void (*ifpoll_stfn_t)(struct ifnet *, int); +typedef void (*ifpoll_stfn_t)(struct ifnet *); struct ifpoll_status { struct lwkt_serialize *serializer;