Skip to contentSkip to conversation

net/mlx5: fix Meter capabilities reporting

PATCH In review Alexander Kozyrev 2 participants 2 messages Feb 7, 2022 – Feb 9, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix Meter capabilities reporting

Meter capabilities reporting is not up to date. Mellanox NICs support RFC2698 and RFC4115 as well as RFC2697. Add these marker operations to the capabilities list.

Fixes 6bc327b94fe ("net/mlx5: fill meter capabilities using DevX")
---
 drivers/net/mlx5/mlx5_flow_meter.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_meter.c +7 -1
index 0dc7fbfb32..d99cc61dd6 100644
@@ -437,11 +437,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;
@@ -449,7 +452,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;
Signature · 1 line
2.18.2
#1 lore raw

Hi,

Quoted 13 lines

-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Sent: Monday, February 7, 2022 3:30 PM
To: [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Suanming Mou <[email protected]>
Subject: [PATCH] net/mlx5: fix Meter capabilities reporting

Meter capabilities reporting is not up to date. Mellanox NICs support RFC2698 and RFC4115 as well as RFC2697. Add these marker operations to the capabilities list.

Quoted 5 lines
Fixes 6bc327b94fe ("net/mlx5: fill meter capabilities using DevX")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh