FreeBSD/sys/netpfil/ipfw/dn_sched_prio.c
/*
 * If a queue with the same priority is already backlogged, use
 * that one instead of the queue passed as argument.
 */
If a queue with the same priority is already backlogged, use
that one instead of the queue passed as argument.
If a queue with the same priority is already backlogged use that one instead of the queue passed as argument .
static int 
prio_enqueue(struct dn_sch_inst *_si, struct dn_queue *q, struct mbuf *m)
{
	struct prio_si *si = (struct prio_si *)(_si + 1);
	int prio = q->fs->fs.par[0];
	if (test_bit(prio, &si->bitmap) == 0) {
		__set_bit(prio, &si->bitmap);
		si->q_array[prio] = q;
	} else { 
		q = si->q_array[prio];
	}
	if (dn_enqueue(q, m, 0))
		return 1;
	return 0;
}
static int prio_enqueue ( struct dn_sch_inst * _si , struct dn_queue * q , struct mbuf * m ) { struct prio_si * si = ( struct prio_si * ) ( _si + 1 ) ; int prio = q -> fs -> fs . par [ 0 ] ; if ( test_bit ( prio , & si -> bitmap ) == 0 ) { __set_bit ( prio , & si -> bitmap ) ; si -> q_array [ prio ] = q ; } else { q = si -> q_array [ prio ] ; } if ( dn_enqueue ( q , m , 0 ) ) return 1 ; return 0 ; }
If a queue with the same priority is already backlogged, use
 that one instead of the queue passed as argument.
If a queue with the same priority is already backlogged use that one instead of the queue passed as argument .
/* No queue with this priority, insert */ /* use the existing queue */