Re: [dpdk-dev] [PATCH] net/mlx5: fix the EIR calculation
From: Raslan Darawsheh <hidden>
Date: 2021-07-29 20:06:50
Hi,
-----Original Message-----
From: Bing Zhao <redacted>
Sent: Thursday, July 29, 2021 7:04 PM
To: Slava Ovsiienko <redacted>; Matan Azrad
[off-list ref]
Cc: dev@dpdk.org; Ori Kam <redacted>; Raslan Darawsheh
[off-list ref]; NBU-Contact-Thomas Monjalon
[off-list ref]
Subject: [PATCH] net/mlx5: fix the EIR calculation
Before the yellow color policy was supported, the only supported profile of
metering is RFC2697 and EIR is not part of the profile.
When creating a meter with this profile, the EIR part was always zero.
After the yellow color policy supported and RFC2698 & 4115 support was
introduced, EIR is relevant and should be calculated. Usually the EIR could not
be zero and the formula for calculating CIR mantissa & exponent could be
reused.
The EIR could be 0 and then only green and red colors will be supported from
the specification. Both the mantissa and exponent parts should be set to 0.
Currently, the formula wrongly sets non-zero values for the EIR=0 case.
Setting the mantissa and the exponent parts to zeros when EIR is 0 will solve
the issue.
Fixes: 33a7493c8df8 ("net/mlx5: support meter for trTCM profiles")
Signed-off-by: Bing Zhao <redacted>
Acked-by: Matan Azrad <redacted>
---
drivers/net/mlx5/mlx5_flow_meter.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh