X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fmlx5_flow_meter.c;h=2310ea6a86f51efaaa1019d2081cd7efebd34c77;hb=e3032e9c73f4791e2cdbab5a37f322c288d7e2aa;hp=d0f8bcd10010a6f35d8b797af081333eb58ec210;hpb=21fdeab422e0edabc6b738f7a0c56dec7e9c374e;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c index d0f8bcd100..2310ea6a86 100644 --- a/drivers/net/mlx5/mlx5_flow_meter.c +++ b/drivers/net/mlx5/mlx5_flow_meter.c @@ -155,7 +155,7 @@ mlx5_flow_meter_profile_validate(struct rte_eth_dev *dev, "Meter profile already exists."); if (!priv->sh->meter_aso_en) { /* Old version is even not supported. */ - if (!priv->config.hca_attr.qos.flow_meter_old) + if (!priv->sh->cdev->config.hca_attr.qos.flow_meter_old) return -rte_mtr_error_set(error, ENOTSUP, RTE_MTR_ERROR_TYPE_METER_PROFILE, NULL, "Metering is not supported."); @@ -428,7 +428,7 @@ mlx5_flow_mtr_cap_get(struct rte_eth_dev *dev, struct rte_mtr_error *error __rte_unused) { struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_hca_qos_attr *qattr = &priv->config.hca_attr.qos; + struct mlx5_hca_qos_attr *qattr = &priv->sh->cdev->config.hca_attr.qos; if (!priv->mtr_en) return -rte_mtr_error_set(error, ENOTSUP, @@ -439,11 +439,14 @@ mlx5_flow_mtr_cap_get(struct rte_eth_dev *dev, /* 2 meters per one ASO cache line. */ cap->n_max = 1 << (qattr->log_max_num_meter_aso + 1); cap->srtcm_rfc2697_packet_mode_supported = 1; + cap->trtcm_rfc2698_packet_mode_supported = 1; + cap->trtcm_rfc4115_packet_mode_supported = 1; } else { cap->n_max = 1 << qattr->log_max_flow_meter; - cap->srtcm_rfc2697_packet_mode_supported = 0; } cap->srtcm_rfc2697_byte_mode_supported = 1; + cap->trtcm_rfc2698_byte_mode_supported = 1; + cap->trtcm_rfc4115_byte_mode_supported = 1; cap->n_shared_max = cap->n_max; cap->identical = 1; cap->shared_identical = 1; @@ -451,7 +454,10 @@ mlx5_flow_mtr_cap_get(struct rte_eth_dev *dev, /* 2M flows can share the same meter. */ cap->chaining_n_mtrs_per_flow_max = 1; /* Chaining is not supported. */ cap->meter_srtcm_rfc2697_n_max = qattr->flow_meter_old ? cap->n_max : 0; + cap->meter_trtcm_rfc2698_n_max = qattr->flow_meter_old ? cap->n_max : 0; + cap->meter_trtcm_rfc4115_n_max = qattr->flow_meter_old ? cap->n_max : 0; cap->meter_rate_max = 1ULL << 40; /* 1 Tera tokens per sec. */ + cap->meter_policy_n_max = cap->n_max; cap->stats_mask = RTE_MTR_STATS_N_BYTES_DROPPED | RTE_MTR_STATS_N_PKTS_DROPPED; return 0;