FreeBSD/sys/dev/dpaa/qman.c
/**
 * @group QMan API functions implementation.
 * @{
 */
@group QMan API functions implementation.
@group QMan API functions implementation .
t_Handle
qman_fqr_create(uint32_t fqids_num, e_QmFQChannel channel, uint8_t wq,
    bool force_fqid, uint32_t fqid_or_align, bool init_parked,
    bool hold_active, bool prefer_in_cache, bool congst_avoid_ena,
    t_Handle congst_group, int8_t overhead_accounting_len,
    uint32_t tail_drop_threshold)
{
	struct qman_softc *sc;
	t_QmFqrParams fqr;
	unsigned int cpu;
	t_Handle fqrh, portal;
	sc = qman_sc;
	sched_pin();
	cpu = PCPU_GET(cpuid);
	portal = qman_portal_setup(sc);
	if (portal == NULL) {
		device_printf(sc->sc_dev, "could not setup QMan portal\n");
		goto err;
	}
	fqr.h_Qm = sc->sc_qh;
	fqr.h_QmPortal = portal;
	fqr.initParked = init_parked;
	fqr.holdActive = hold_active;
	fqr.preferInCache = prefer_in_cache;
	fqr.useContextAForStash = FALSE;
	fqr.p_ContextA = 0;
	fqr.p_ContextB = 0;
	fqr.channel = channel;
	fqr.wq = wq;
	fqr.shadowMode = FALSE;
	fqr.numOfFqids = fqids_num;
	fqr.useForce = force_fqid;
	if (force_fqid) {
		fqr.qs.frcQ.fqid = fqid_or_align;
	} else {
		fqr.qs.nonFrcQs.align = fqid_or_align;
	}
	fqr.congestionAvoidanceEnable = congst_avoid_ena;
	if (congst_avoid_ena) {
		fqr.congestionAvoidanceParams.h_QmCg = congst_group;
		fqr.congestionAvoidanceParams.overheadAccountingLength =
		    overhead_accounting_len;
		fqr.congestionAvoidanceParams.fqTailDropThreshold =
		    tail_drop_threshold;
	} else {
		fqr.congestionAvoidanceParams.h_QmCg = 0;
		fqr.congestionAvoidanceParams.overheadAccountingLength = 0;
		fqr.congestionAvoidanceParams.fqTailDropThreshold = 0;
	}
	fqrh = QM_FQR_Create(&fqr);
	if (fqrh == NULL) {
		device_printf(sc->sc_dev, "could not create Frame Queue Range"
		    "\n");
		goto err;
	}
	sc->sc_fqr_cpu[QM_FQR_GetFqid(fqrh)] = PCPU_GET(cpuid);
	sched_unpin();
	return (fqrh);
err:
	sched_unpin();
	return (NULL);
}
t_Handle qman_fqr_create ( uint32_t fqids_num , e_QmFQChannel channel , uint8_t wq , bool force_fqid , uint32_t fqid_or_align , bool init_parked , bool hold_active , bool prefer_in_cache , bool congst_avoid_ena , t_Handle congst_group , int8_t overhead_accounting_len , uint32_t tail_drop_threshold ) { struct qman_softc * sc ; t_QmFqrParams fqr ; unsigned int cpu ; t_Handle fqrh , portal ; sc = qman_sc ; sched_pin ( ) ; cpu = PCPU_GET ( cpuid ) ; portal = qman_portal_setup ( sc ) ; if ( portal == NULL ) { device_printf ( sc -> sc_dev , " \n " ) ; goto err ; } fqr . h_Qm = sc -> sc_qh ; fqr . h_QmPortal = portal ; fqr . initParked = init_parked ; fqr . holdActive = hold_active ; fqr . preferInCache = prefer_in_cache ; fqr . useContextAForStash = FALSE ; fqr . p_ContextA = 0 ; fqr . p_ContextB = 0 ; fqr . channel = channel ; fqr . wq = wq ; fqr . shadowMode = FALSE ; fqr . numOfFqids = fqids_num ; fqr . useForce = force_fqid ; if ( force_fqid ) { fqr . qs . frcQ . fqid = fqid_or_align ; } else { fqr . qs . nonFrcQs . align = fqid_or_align ; } fqr . congestionAvoidanceEnable = congst_avoid_ena ; if ( congst_avoid_ena ) { fqr . congestionAvoidanceParams . h_QmCg = congst_group ; fqr . congestionAvoidanceParams . overheadAccountingLength = overhead_accounting_len ; fqr . congestionAvoidanceParams . fqTailDropThreshold = tail_drop_threshold ; } else { fqr . congestionAvoidanceParams . h_QmCg = 0 ; fqr . congestionAvoidanceParams . overheadAccountingLength = 0 ; fqr . congestionAvoidanceParams . fqTailDropThreshold = 0 ; } fqrh = QM_FQR_Create ( & fqr ) ; if ( fqrh == NULL ) { device_printf ( sc -> sc_dev , " " " \n " ) ; goto err ; } sc -> sc_fqr_cpu [ QM_FQR_GetFqid ( fqrh ) ] = PCPU_GET ( cpuid ) ; sched_unpin ( ) ; return ( fqrh ) ; err : sched_unpin ( ) ; return ( NULL ) ; }
@group QMan API functions implementation.
@group QMan API functions implementation .
/* Ensure we have got QMan port initialized */ /* We do not support stashing */ /* FQID */ /* Congestion Avoidance */