FreeBSD/sys/net/altq/altq_subr.c
/*
 * add a discipline or a queue
 * Locking is done in the discipline specific functions with regards to
 * malloc with WAITOK, also it is not yet clear which lock to use.
 */
add a discipline or a queue
Locking is done in the discipline specific functions with regards to
malloc with WAITOK, also it is not yet clear which lock to use.
add a discipline or a queue Locking is done in the discipline specific functions with regards to malloc with WAITOK also it is not yet clear which lock to use .
int
altq_add(struct pf_altq *a)
{
	int error = 0;
	if (a->qname[0] != 0)
		return (altq_add_queue(a));
	if (machclk_freq == 0)
		init_machclk();
	if (machclk_freq == 0)
		panic("altq_add: no cpu clock");
	switch (a->scheduler) {
#ifdef ALTQ_CBQ
	case ALTQT_CBQ:
		error = cbq_add_altq(a);
		break;
#endif
#ifdef ALTQ_PRIQ
	case ALTQT_PRIQ:
		error = priq_add_altq(a);
		break;
#endif
#ifdef ALTQ_HFSC
	case ALTQT_HFSC:
		error = hfsc_add_altq(a);
		break;
#endif
#ifdef ALTQ_FAIRQ
        case ALTQT_FAIRQ:
                error = fairq_add_altq(a);
                break;
#endif
#ifdef ALTQ_CODEL
	case ALTQT_CODEL:
		error = codel_add_altq(a);
		break;
#endif
	default:
		error = ENXIO;
	}
	return (error);
}
int altq_add ( struct pf_altq * a ) { int error = 0 ; if ( a -> qname [ 0 ] != 0 ) return ( altq_add_queue ( a ) ) ; if ( machclk_freq == 0 ) init_machclk ( ) ; if ( machclk_freq == 0 ) panic ( " " ) ; switch ( a -> scheduler ) { #ifdef ALTQ_CBQ case ALTQT_CBQ : error = cbq_add_altq ( a ) ; break ; #endif #ifdef ALTQ_PRIQ case ALTQT_PRIQ : error = priq_add_altq ( a ) ; break ; #endif #ifdef ALTQ_HFSC case ALTQT_HFSC : error = hfsc_add_altq ( a ) ; break ; #endif #ifdef ALTQ_FAIRQ case ALTQT_FAIRQ : error = fairq_add_altq ( a ) ; break ; #endif #ifdef ALTQ_CODEL case ALTQT_CODEL : error = codel_add_altq ( a ) ; break ; #endif default : error = ENXIO ; } return ( error ) ; }
add a discipline or a queue
 Locking is done in the discipline specific functions with regards to
 malloc with WAITOK, also it is not yet clear which lock to use.
add a discipline or a queue Locking is done in the discipline specific functions with regards to malloc with WAITOK also it is not yet clear which lock to use .