FreeBSD/sys/net/netisr.c
/*
 * Query current drop counters across all workstreams for a protocol.
 */
Query current drop counters across all workstreams for a protocol.
Query current drop counters across all workstreams for a protocol .
void
netisr_getqdrops(const struct netisr_handler *nhp, u_int64_t *qdropp)
{
	struct netisr_work *npwp;
	struct rm_priotracker tracker;
#ifdef INVARIANTS
	const char *name;
#endif
	u_int i, proto;
	*qdropp = 0;
	proto = nhp->nh_proto;
#ifdef INVARIANTS
	name = nhp->nh_name;
#endif
	KASSERT(proto < NETISR_MAXPROT,
	    ("%s(%u): protocol too big for %s", __func__, proto, name));
	NETISR_RLOCK(&tracker);
	KASSERT(netisr_proto[proto].np_handler != NULL,
	    ("%s(%u): protocol not registered for %s", __func__, proto,
	    name));
	CPU_FOREACH(i) {
		npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
		*qdropp += npwp->nw_qdrops;
	}
	NETISR_RUNLOCK(&tracker);
}
void netisr_getqdrops ( const struct netisr_handler * nhp , u_int64_t * qdropp ) { struct netisr_work * npwp ; struct rm_priotracker tracker ; #ifdef INVARIANTS const char * name ; #endif u_int i , proto ; * qdropp = 0 ; proto = nhp -> nh_proto ; #ifdef INVARIANTS name = nhp -> nh_name ; #endif KASSERT ( proto < NETISR_MAXPROT , ( " " , __func__ , proto , name ) ) ; NETISR_RLOCK ( & tracker ) ; KASSERT ( netisr_proto [ proto ] . np_handler != NULL , ( " " , __func__ , proto , name ) ) ; CPU_FOREACH ( i ) { npwp = & ( DPCPU_ID_PTR ( i , nws ) ) -> nws_work [ proto ] ; * qdropp += npwp -> nw_qdrops ; } NETISR_RUNLOCK ( & tracker ) ; }
Query current drop counters across all workstreams for a protocol.
Query current drop counters across all workstreams for a protocol .