src/dpdk/drivers/net/cxgbe/cxgbe_main.c
int cxgb4_set_rspq_intr_params(struct sge_rspq *q, unsigned int us,
			       unsigned int cnt)
{
	struct adapter *adap = q->adapter;
	unsigned int timer_val;

	if (cnt) {
		int err;
		u32 v, new_idx;

		new_idx = closest_thres(&adap->sge, cnt);
		if (q->desc && q->pktcnt_idx != new_idx) {
			/* the queue has already been created, update it */
			v = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
			    V_FW_PARAMS_PARAM_X(
			    FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) |
			    V_FW_PARAMS_PARAM_YZ(q->cntxt_id);
			err = t4_set_params(adap, adap->mbox, adap->pf, 0, 1,
					    &v, &new_idx);
			if (err)
				return err;
		}
		q->pktcnt_idx = new_idx;
	}

	timer_val = (us == 0) ? X_TIMERREG_RESTART_COUNTER :
				closest_timer(&adap->sge, us);

	if ((us | cnt) == 0)
		q->intr_params = V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX);
	else
		q->intr_params = V_QINTR_TIMER_IDX(timer_val) |
				 V_QINTR_CNT_EN(cnt > 0);
	return 0;
}
/**
 * cxgb4_set_rspq_intr_params - set a queue's interrupt holdoff parameters
 * @q: the Rx queue
 * @us: the hold-off time in us, or 0 to disable timer
 * @cnt: the hold-off packet count, or 0 to disable counter
 *
 * Sets an Rx queue's interrupt hold-off time and packet count.  At least
 * one of the two needs to be enabled for the queue to generate interrupts.
 */
set a queue's interrupt holdoff parameters
@q: the Rx queue
@us: the hold-off time in us, or 0 to disable timer
@cnt: the hold-off packet count, or 0 to disable counter

Sets an Rx queue's interrupt hold-off time and packet count.  At least
one of the two needs to be enabled for the queue to generate interrupts.
set a queue ' s interrupt holdoff parameters @q : the Rx queue @us : the hold - off time in us or 0 to disable timer @cnt : the hold - off packet count or 0 to disable counter Sets an Rx queue ' s interrupt hold - off time and packet count . At least one of the two needs to be enabled for the queue to generate interrupts .
int cxgb4_set_rspq_intr_params(struct sge_rspq *q, unsigned int us,
			       unsigned int cnt)
{
	struct adapter *adap = q->adapter;
	unsigned int timer_val;
	if (cnt) {
		int err;
		u32 v, new_idx;
		new_idx = closest_thres(&adap->sge, cnt);
		if (q->desc && q->pktcnt_idx != new_idx) {
			v = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
			    V_FW_PARAMS_PARAM_X(
			    FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) |
			    V_FW_PARAMS_PARAM_YZ(q->cntxt_id);
			err = t4_set_params(adap, adap->mbox, adap->pf, 0, 1,
					    &v, &new_idx);
			if (err)
				return err;
		}
		q->pktcnt_idx = new_idx;
	}
	timer_val = (us == 0) ? X_TIMERREG_RESTART_COUNTER :
				closest_timer(&adap->sge, us);
	if ((us | cnt) == 0)
		q->intr_params = V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX);
	else
		q->intr_params = V_QINTR_TIMER_IDX(timer_val) |
				 V_QINTR_CNT_EN(cnt > 0);
	return 0;
}
int cxgb4_set_rspq_intr_params ( struct sge_rspq * q , unsigned int us , unsigned int cnt ) { struct adapter * adap = q -> adapter ; unsigned int timer_val ; if ( cnt ) { int err ; u32 v , new_idx ; new_idx = closest_thres ( & adap -> sge , cnt ) ; if ( q -> desc && q -> pktcnt_idx != new_idx ) { v = V_FW_PARAMS_MNEM ( FW_PARAMS_MNEM_DMAQ ) | V_FW_PARAMS_PARAM_X ( FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH ) | V_FW_PARAMS_PARAM_YZ ( q -> cntxt_id ) ; err = t4_set_params ( adap , adap -> mbox , adap -> pf , 0 , 1 , & v , & new_idx ) ; if ( err ) return err ; } q -> pktcnt_idx = new_idx ; } timer_val = ( us == 0 ) ? X_TIMERREG_RESTART_COUNTER : closest_timer ( & adap -> sge , us ) ; if ( ( us | cnt ) == 0 ) q -> intr_params = V_QINTR_TIMER_IDX ( X_TIMERREG_UPDATE_CIDX ) ; else q -> intr_params = V_QINTR_TIMER_IDX ( timer_val ) | V_QINTR_CNT_EN ( cnt > 0 ) ; return 0 ; }
cxgb4_set_rspq_intr_params - set a queue's interrupt holdoff parameters
 @q: the Rx queue
 @us: the hold-off time in us, or 0 to disable timer
 @cnt: the hold-off packet count, or 0 to disable counter
cxgb4_set_rspq_intr_params - set a queue ' s interrupt holdoff parameters @q : the Rx queue @us : the hold - off time in us or 0 to disable timer @cnt : the hold - off packet count or 0 to disable counter
/* the queue has already been created, update it */