src/dpdk/drivers/net/mvpp2/mrvl_flow.c
static int
mrvl_create_cls_table(struct rte_eth_dev *dev, struct rte_flow *first_flow)
{
	struct mrvl_priv *priv = dev->data->dev_private;
	struct pp2_cls_tbl_key *key = &priv->cls_tbl_params.key;
	int ret;

	if (priv->cls_tbl) {
		pp2_cls_tbl_deinit(priv->cls_tbl);
		priv->cls_tbl = NULL;
	}

	memset(&priv->cls_tbl_params, 0, sizeof(priv->cls_tbl_params));

	priv->cls_tbl_params.type = mrvl_engine_type(first_flow);
	MRVL_LOG(INFO, "Setting cls search engine type to %s",
			priv->cls_tbl_params.type == PP2_CLS_TBL_EXACT_MATCH ?
			"exact" : "maskable");
	priv->cls_tbl_params.max_num_rules = MRVL_CLS_MAX_NUM_RULES;
	priv->cls_tbl_params.default_act.type = PP2_CLS_TBL_ACT_DONE;
	priv->cls_tbl_params.default_act.cos = &first_flow->cos;
	memcpy(key, &first_flow->table_key, sizeof(struct pp2_cls_tbl_key));

	ret = pp2_cls_tbl_init(&priv->cls_tbl_params, &priv->cls_tbl);

	return ret;
}
/**
 * Create classifier table.
 *
 * @param dev Pointer to the device.
 * @param flow Pointer to the very first flow.
 * @returns 0 in case of success, negative value otherwise.
 */
Create classifier table.
@param dev Pointer to the device.
@param flow Pointer to the very first flow.
@returns 0 in case of success, negative value otherwise.
Create classifier table . @param dev Pointer to the device . @param flow Pointer to the very first flow . @returns 0 in case of success negative value otherwise .
static int
mrvl_create_cls_table(struct rte_eth_dev *dev, struct rte_flow *first_flow)
{
	struct mrvl_priv *priv = dev->data->dev_private;
	struct pp2_cls_tbl_key *key = &priv->cls_tbl_params.key;
	int ret;
	if (priv->cls_tbl) {
		pp2_cls_tbl_deinit(priv->cls_tbl);
		priv->cls_tbl = NULL;
	}
	memset(&priv->cls_tbl_params, 0, sizeof(priv->cls_tbl_params));
	priv->cls_tbl_params.type = mrvl_engine_type(first_flow);
	MRVL_LOG(INFO, "Setting cls search engine type to %s",
			priv->cls_tbl_params.type == PP2_CLS_TBL_EXACT_MATCH ?
			"exact" : "maskable");
	priv->cls_tbl_params.max_num_rules = MRVL_CLS_MAX_NUM_RULES;
	priv->cls_tbl_params.default_act.type = PP2_CLS_TBL_ACT_DONE;
	priv->cls_tbl_params.default_act.cos = &first_flow->cos;
	memcpy(key, &first_flow->table_key, sizeof(struct pp2_cls_tbl_key));
	ret = pp2_cls_tbl_init(&priv->cls_tbl_params, &priv->cls_tbl);
	return ret;
}
static int mrvl_create_cls_table ( struct rte_eth_dev * dev , struct rte_flow * first_flow ) { struct mrvl_priv * priv = dev -> data -> dev_private ; struct pp2_cls_tbl_key * key = & priv -> cls_tbl_params . key ; int ret ; if ( priv -> cls_tbl ) { pp2_cls_tbl_deinit ( priv -> cls_tbl ) ; priv -> cls_tbl = NULL ; } memset ( & priv -> cls_tbl_params , 0 , sizeof ( priv -> cls_tbl_params ) ) ; priv -> cls_tbl_params . type = mrvl_engine_type ( first_flow ) ; MRVL_LOG ( INFO , " " , priv -> cls_tbl_params . type == PP2_CLS_TBL_EXACT_MATCH ? " " : " " ) ; priv -> cls_tbl_params . max_num_rules = MRVL_CLS_MAX_NUM_RULES ; priv -> cls_tbl_params . default_act . type = PP2_CLS_TBL_ACT_DONE ; priv -> cls_tbl_params . default_act . cos = & first_flow -> cos ; memcpy ( key , & first_flow -> table_key , sizeof ( struct pp2_cls_tbl_key ) ) ; ret = pp2_cls_tbl_init ( & priv -> cls_tbl_params , & priv -> cls_tbl ) ; return ret ; }
Create classifier table.
Create classifier table .