uint32_t dv_regc0_mask; /* available bits of metatada reg_c[0]. */
uint32_t dv_refcnt; /* DV/DR data reference counter. */
void *fdb_domain; /* FDB Direct Rules name space handle. */
- struct mlx5_flow_tbl_resource *fdb_mtr_sfx_tbl;
- /* FDB meter suffix rules table. */
void *rx_domain; /* RX Direct Rules name space handle. */
- struct mlx5_flow_tbl_resource *rx_mtr_sfx_tbl;
- /* RX meter suffix rules table. */
void *tx_domain; /* TX Direct Rules name space handle. */
- struct mlx5_flow_tbl_resource *tx_mtr_sfx_tbl;
- /* TX meter suffix rules table. */
struct mlx5_hlist *flow_tbls;
/* Direct Rules tables for FDB, NIC TX+RX */
void *esw_drop_action; /* Pointer to DR E-Switch drop action. */
if (mtd->egress.tbl)
claim_zero(flow_dv_tbl_resource_release(dev,
mtd->egress.tbl));
+ if (mtd->egress.sfx_tbl)
+ claim_zero(flow_dv_tbl_resource_release(dev,
+ mtd->egress.sfx_tbl));
if (mtd->ingress.color_matcher)
claim_zero(mlx5_glue->dv_destroy_flow_matcher
(mtd->ingress.color_matcher));
if (mtd->ingress.tbl)
claim_zero(flow_dv_tbl_resource_release(dev,
mtd->ingress.tbl));
+ if (mtd->ingress.sfx_tbl)
+ claim_zero(flow_dv_tbl_resource_release(dev,
+ mtd->ingress.sfx_tbl));
if (mtd->transfer.color_matcher)
claim_zero(mlx5_glue->dv_destroy_flow_matcher
(mtd->transfer.color_matcher));
if (mtd->transfer.tbl)
claim_zero(flow_dv_tbl_resource_release(dev,
mtd->transfer.tbl));
+ if (mtd->transfer.sfx_tbl)
+ claim_zero(flow_dv_tbl_resource_release(dev,
+ mtd->transfer.sfx_tbl));
if (mtd->drop_actn)
claim_zero(mlx5_glue->destroy_flow_action(mtd->drop_actn));
rte_free(mtd);
.match_mask = (void *)&mask,
};
void *actions[METER_ACTIONS];
- struct mlx5_flow_tbl_resource **sfx_tbl;
struct mlx5_meter_domain_info *dtb;
struct rte_flow_error error;
int i = 0;
- if (transfer) {
- sfx_tbl = &sh->fdb_mtr_sfx_tbl;
+ if (transfer)
dtb = &mtb->transfer;
- } else if (egress) {
- sfx_tbl = &sh->tx_mtr_sfx_tbl;
+ else if (egress)
dtb = &mtb->egress;
- } else {
- sfx_tbl = &sh->rx_mtr_sfx_tbl;
+ else
dtb = &mtb->ingress;
- }
- /* If the suffix table in missing, create it. */
- if (!(*sfx_tbl)) {
- *sfx_tbl = flow_dv_tbl_resource_get(dev,
- MLX5_FLOW_TABLE_LEVEL_SUFFIX,
- egress, transfer, &error);
- if (!(*sfx_tbl)) {
- DRV_LOG(ERR, "Failed to create meter suffix table.");
- return -1;
- }
- }
/* Create the meter table with METER level. */
dtb->tbl = flow_dv_tbl_resource_get(dev, MLX5_FLOW_TABLE_LEVEL_METER,
egress, transfer, &error);
DRV_LOG(ERR, "Failed to create meter policer table.");
return -1;
}
+ /* Create the meter suffix table with SUFFIX level. */
+ dtb->sfx_tbl = flow_dv_tbl_resource_get(dev,
+ MLX5_FLOW_TABLE_LEVEL_SUFFIX,
+ egress, transfer, &error);
+ if (!dtb->sfx_tbl) {
+ DRV_LOG(ERR, "Failed to create meter suffix table.");
+ return -1;
+ }
/* Create matchers, Any and Color. */
dv_attr.priority = 3;
dv_attr.match_criteria_enable = 0;
* Pointer to flow meter structure.
* @param[in] mtb
* Pointer to DV meter table set.
- * @param[in] sfx_tb
- * Pointer to suffix table.
* @param[in] mtr_reg_c
* Color match REG_C.
*
static int
flow_dv_create_policer_forward_rule(struct mlx5_flow_meter *fm,
struct mlx5_meter_domain_info *dtb,
- struct mlx5_flow_tbl_resource *sfx_tb,
uint8_t mtr_reg_c)
{
struct mlx5_flow_dv_match_params matcher = {
int i;
/* Create jump action. */
- if (!sfx_tb)
- return -1;
if (!dtb->jump_actn)
dtb->jump_actn =
mlx5_glue->dr_create_flow_action_dest_flow_tbl
- (sfx_tb->obj);
+ (dtb->sfx_tbl->obj);
if (!dtb->jump_actn) {
DRV_LOG(ERR, "Failed to create policer jump action.");
goto error;
if (attr->egress) {
ret = flow_dv_create_policer_forward_rule(fm, &mtb->egress,
- priv->sh->tx_mtr_sfx_tbl,
priv->mtr_color_reg);
if (ret) {
DRV_LOG(ERR, "Failed to create egress policer.");
}
if (attr->ingress) {
ret = flow_dv_create_policer_forward_rule(fm, &mtb->ingress,
- priv->sh->rx_mtr_sfx_tbl,
priv->mtr_color_reg);
if (ret) {
DRV_LOG(ERR, "Failed to create ingress policer.");
}
if (attr->transfer) {
ret = flow_dv_create_policer_forward_rule(fm, &mtb->transfer,
- priv->sh->fdb_mtr_sfx_tbl,
priv->mtr_color_reg);
if (ret) {
DRV_LOG(ERR, "Failed to create transfer policer.");