FreeBSD/sys/net/netisr.c
/*
 * Update the queue limit across per-workstream queues for a protocol.  We
 * simply change the limits, and don't drain overflowed packets as they will
 * (hopefully) take care of themselves shortly.
 */
Update the queue limit across per-workstream queues for a protocol.  We
simply change the limits, and don't drain overflowed packets as they will
(hopefully) take care of themselves shortly.
Update the queue limit across per - workstream queues for a protocol . We simply change the limits and don ' t drain overflowed packets as they will ( hopefully ) take care of themselves shortly .
int
netisr_setqlimit(const struct netisr_handler *nhp, u_int qlimit)
{
	struct netisr_work *npwp;
#ifdef INVARIANTS
	const char *name;
#endif
	u_int i, proto;
	if (qlimit > netisr_maxqlimit)
		return (EINVAL);
	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));
	netisr_proto[proto].np_qlimit = qlimit;
	CPU_FOREACH(i) {
		npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
		npwp->nw_qlimit = qlimit;
	}
	NETISR_WUNLOCK();
	return (0);
}
int netisr_setqlimit ( const struct netisr_handler * nhp , u_int qlimit ) { struct netisr_work * npwp ; #ifdef INVARIANTS const char * name ; #endif u_int i , proto ; if ( qlimit > netisr_maxqlimit ) return ( EINVAL ) ; 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 ) ) ; netisr_proto [ proto ] . np_qlimit = qlimit ; CPU_FOREACH ( i ) { npwp = & ( DPCPU_ID_PTR ( i , nws ) ) -> nws_work [ proto ] ; npwp -> nw_qlimit = qlimit ; } NETISR_WUNLOCK ( ) ; return ( 0 ) ; }
Update the queue limit across per-workstream queues for a protocol.
Update the queue limit across per - workstream queues for a protocol .