src/dpdk/drivers/net/cxgbe/cxgbe_filter.c
void cxgbe_filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl)
{
	struct filter_entry *f = NULL;
	unsigned int tid = GET_TID(rpl);
	int idx, max_fidx = adap->tids.nftids;

	/* Get the corresponding filter entry for this tid */
	if (adap->tids.ftid_tab) {
		/* Check this in normal filter region */
		idx = tid - adap->tids.ftid_base;
		if (idx >= max_fidx)
			return;

		f = &adap->tids.ftid_tab[idx];
		if (f->tid != tid)
			return;
	}

	/* We found the filter entry for this tid */
	if (f) {
		unsigned int ret = G_COOKIE(rpl->cookie);
		struct filter_ctx *ctx;

		/*
		 * Pull off any filter operation context attached to the
		 * filter.
		 */
		ctx = f->ctx;
		f->ctx = NULL;

		if (ret == FW_FILTER_WR_FLT_ADDED) {
			f->pending = 0;  /* asynchronous setup completed */
			f->valid = 1;
			if (ctx) {
				ctx->tid = f->tid;
				ctx->result = 0;
			}
		} else if (ret == FW_FILTER_WR_FLT_DELETED) {
			/*
			 * Clear the filter when we get confirmation from the
			 * hardware that the filter has been deleted.
			 */
			clear_filter(f);
			if (ctx)
				ctx->result = 0;
		} else {
			/*
			 * Something went wrong.  Issue a warning about the
			 * problem and clear everything out.
			 */
			dev_warn(adap, "filter %u setup failed with error %u\n",
				 idx, ret);
			clear_filter(f);
			if (ctx)
				ctx->result = -EINVAL;
		}

		if (ctx)
			t4_complete(&ctx->completion);
	}
}
/**
 * Handle a LE-TCAM filter write/deletion reply.
 */
Handle a LE-TCAM filter write/deletion reply.
Handle a LE - TCAM filter write / deletion reply .
void cxgbe_filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl)
{
	struct filter_entry *f = NULL;
	unsigned int tid = GET_TID(rpl);
	int idx, max_fidx = adap->tids.nftids;
	if (adap->tids.ftid_tab) {
		idx = tid - adap->tids.ftid_base;
		if (idx >= max_fidx)
			return;
		f = &adap->tids.ftid_tab[idx];
		if (f->tid != tid)
			return;
	}
	if (f) {
		unsigned int ret = G_COOKIE(rpl->cookie);
		struct filter_ctx *ctx;
		ctx = f->ctx;
		f->ctx = NULL;
		if (ret == FW_FILTER_WR_FLT_ADDED) {
			f->pending = 0;  
			f->valid = 1;
			if (ctx) {
				ctx->tid = f->tid;
				ctx->result = 0;
			}
		} else if (ret == FW_FILTER_WR_FLT_DELETED) {
			clear_filter(f);
			if (ctx)
				ctx->result = 0;
		} else {
			dev_warn(adap, "filter %u setup failed with error %u\n",
				 idx, ret);
			clear_filter(f);
			if (ctx)
				ctx->result = -EINVAL;
		}
		if (ctx)
			t4_complete(&ctx->completion);
	}
}
void cxgbe_filter_rpl ( struct adapter * adap , const struct cpl_set_tcb_rpl * rpl ) { struct filter_entry * f = NULL ; unsigned int tid = GET_TID ( rpl ) ; int idx , max_fidx = adap -> tids . nftids ; if ( adap -> tids . ftid_tab ) { idx = tid - adap -> tids . ftid_base ; if ( idx >= max_fidx ) return ; f = & adap -> tids . ftid_tab [ idx ] ; if ( f -> tid != tid ) return ; } if ( f ) { unsigned int ret = G_COOKIE ( rpl -> cookie ) ; struct filter_ctx * ctx ; ctx = f -> ctx ; f -> ctx = NULL ; if ( ret == FW_FILTER_WR_FLT_ADDED ) { f -> pending = 0 ; f -> valid = 1 ; if ( ctx ) { ctx -> tid = f -> tid ; ctx -> result = 0 ; } } else if ( ret == FW_FILTER_WR_FLT_DELETED ) { clear_filter ( f ) ; if ( ctx ) ctx -> result = 0 ; } else { dev_warn ( adap , " \n " , idx , ret ) ; clear_filter ( f ) ; if ( ctx ) ctx -> result = - EINVAL ; } if ( ctx ) t4_complete ( & ctx -> completion ) ; } }
Handle a LE-TCAM filter write/deletion reply.
Handle a LE - TCAM filter write / deletion reply .
/* Get the corresponding filter entry for this tid */ /* Check this in normal filter region */ /* We found the filter entry for this tid */ /*
		 * Pull off any filter operation context attached to the
		 * filter.
		 */ /* asynchronous setup completed */ /*
			 * Clear the filter when we get confirmation from the
			 * hardware that the filter has been deleted.
			 */ /*
			 * Something went wrong.  Issue a warning about the
			 * problem and clear everything out.
			 */