Index: hfsc.c =================================================================== RCS file: /cvs/src/sys/net/hfsc.c,v retrieving revision 1.21 diff -u -p -r1.21 hfsc.c --- hfsc.c 18 Apr 2015 11:12:33 -0000 1.21 +++ hfsc.c 18 May 2015 01:31:03 -0000 @@ -259,12 +259,17 @@ void hfsc_getclstats(struct hfsc_class_ struct hfsc_class *hfsc_clh2cph(struct hfsc_if *, u_int32_t); #define HFSC_CLK_SHIFT 8 -#define HFSC_FREQ (1000000 << HFSC_CLK_SHIFT) +//#define HFSC_FREQ (1000000 << HFSC_CLK_SHIFT) +#define HFSC_FREQ (curcpu()->ci_tsc_freq) #define HFSC_CLK_PER_TICK (HFSC_FREQ / hz) #define HFSC_HT_INFINITY 0xffffffffffffffffLL /* infinite time value */ struct pool hfsc_class_pl, hfsc_internal_sc_pl; +#include +#define hfsc_microuptime() rdtsc(); + +#if 0 u_int64_t hfsc_microuptime(void) { @@ -274,6 +279,7 @@ hfsc_microuptime(void) return (((u_int64_t)(tv.tv_sec) * 1000000 + tv.tv_usec) << HFSC_CLK_SHIFT); } +#endif static inline u_int hfsc_more_slots(u_int current) Index: hfsc.h =================================================================== RCS file: /cvs/src/sys/net/hfsc.h,v retrieving revision 1.8 diff -u -p -r1.8 hfsc.h --- hfsc.h 12 Apr 2015 09:58:46 -0000 1.8 +++ hfsc.h 18 May 2015 01:31:03 -0000 @@ -121,7 +121,6 @@ int hfsc_detach(struct ifnet *); void hfsc_purge(struct ifqueue *); int hfsc_enqueue(struct ifqueue *, struct mbuf *); struct mbuf *hfsc_dequeue(struct ifqueue *, int); -u_int64_t hfsc_microuptime(void); int hfsc_addqueue(struct pf_queuespec *); int hfsc_delqueue(struct pf_queuespec *); int hfsc_qstats(struct pf_queuespec *, void *, int *); Index: if.c =================================================================== RCS file: /cvs/src/sys/net/if.c,v retrieving revision 1.330 diff -u -p -r1.330 if.c --- if.c 23 Apr 2015 09:45:24 -0000 1.330 +++ if.c 18 May 2015 01:31:03 -0000 @@ -81,6 +81,8 @@ #include #include +#include + #include #include #include @@ -490,6 +492,8 @@ if_input_process(void *xmq) mq_delist(mq, &ml); if (ml_empty(&ml)) return; + + add_net_randomness(ml_len(&ml)); KERNEL_LOCK(); s = splnet(); Index: if_ethersubr.c =================================================================== RCS file: /cvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.196 diff -u -p -r1.196 if_ethersubr.c --- if_ethersubr.c 11 May 2015 08:41:43 -0000 1.196 +++ if_ethersubr.c 18 May 2015 01:31:03 -0000 @@ -101,8 +101,6 @@ didn't get a copy, you may request one f #include #include -#include - #if NBPFILTER > 0 #include #endif @@ -505,11 +503,6 @@ ether_input(struct mbuf *m, void *hdr) ifp->if_ibytes += m->m_pkthdr.len + sizeof(*eh); etype = ntohs(eh->ether_type); - - if (!(netisr & (1 << NETISR_RND_DONE))) { - add_net_randomness(etype); - atomic_setbits_int(&netisr, (1 << NETISR_RND_DONE)); - } #if NVLAN > 0 if (((m->m_flags & M_VLANTAG) || etype == ETHERTYPE_VLAN || Index: if_tun.c =================================================================== RCS file: /cvs/src/sys/net/if_tun.c,v retrieving revision 1.139 diff -u -p -r1.139 if_tun.c --- if_tun.c 30 Apr 2015 15:19:50 -0000 1.139 +++ if_tun.c 18 May 2015 01:31:03 -0000 @@ -885,9 +885,6 @@ tunwrite(dev_t dev, struct uio *uio, int #endif if (tp->tun_flags & TUN_LAYER2) { - /* quirk to not add randomness from a virtual device */ - atomic_setbits_int(&netisr, (1 << NETISR_RND_DONE)); - s = splnet(); ether_input_mbuf(ifp, top); splx(s); Index: netisr.h =================================================================== RCS file: /cvs/src/sys/net/netisr.h,v retrieving revision 1.40 diff -u -p -r1.40 netisr.h --- netisr.h 10 Aug 2014 07:28:32 -0000 1.40 +++ netisr.h 18 May 2015 01:31:03 -0000 @@ -50,7 +50,6 @@ * interrupt used for scheduling the network code to calls * on the lowest level routine of each protocol. */ -#define NETISR_RND_DONE 1 #define NETISR_IP 2 /* same as AF_INET */ #define NETISR_TX 3 /* for if_snd processing */ #define NETISR_MPLS 4 /* AF_MPLS would overflow */