FreeBSD/sys/net/netisr.c
/*
 * Clear drop counters across all workstreams for a protocol.
 */
Clear drop counters across all workstreams for a protocol.
Clear drop counters across all workstreams for a protocol .
void
netisr_clearqdrops(const struct netisr_handler *nhp)
{
	struct netisr_work *npwp;
#ifdef INVARIANTS
	const char *name;
#endif
	u_int i, proto;
	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_WLOCK();
	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];
		npwp->nw_qdrops = 0;
	}
	NETISR_WUNLOCK();
}
void netisr_clearqdrops ( const struct netisr_handler * nhp ) { struct netisr_work * npwp ; #ifdef INVARIANTS const char * name ; #endif u_int i , proto ; proto = nhp -> nh_proto ; #ifdef INVARIANTS name = nhp -> nh_name ; #endif KASSERT ( proto < NETISR_MAXPROT , ( " " , __func__ , proto , name ) ) ; NETISR_WLOCK ( ) ; KASSERT ( netisr_proto [ proto ] . np_handler != NULL , ( " " , __func__ , proto , name ) ) ; CPU_FOREACH ( i ) { npwp = & ( DPCPU_ID_PTR ( i , nws ) ) -> nws_work [ proto ] ; npwp -> nw_qdrops = 0 ; } NETISR_WUNLOCK ( ) ; }
Clear drop counters across all workstreams for a protocol.
Clear drop counters across all workstreams for a protocol .