DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix the delay drop bit set overflow
@ 2021-11-12 14:38 Bing Zhao
  2021-11-14 15:28 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Bing Zhao @ 2021-11-12 14:38 UTC (permalink / raw)
  To: viacheslavo, matan; +Cc: dev, rasland

The attribute to record the global control of hairpin queues' delay
drop was defined as a bit-field with one bit, and the intention was
to reduce the memory overhead. In the meanwhile, the macro was
defined as an enumerated value 0x2.

No matter what value inputted via devarg, the lowest bit was always
zero and the higher bits would be ignored. For hairpin queues, the
delay drop attribute couldn't be enabled.

With the commit, the double logical negation is used to fix this.

Fixes: febcac7b46cd ("net/mlx5: support Rx queue delay drop")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index f5990dd757..2f5d74105a 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1978,8 +1978,8 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
 	} else if (strcmp(MLX5_ALLOW_DUPLICATE_PATTERN, key) == 0) {
 		config->allow_duplicate_pattern = !!tmp;
 	} else if (strcmp(MLX5_DELAY_DROP, key) == 0) {
-		config->std_delay_drop = tmp & MLX5_DELAY_DROP_STANDARD;
-		config->hp_delay_drop = tmp & MLX5_DELAY_DROP_HAIRPIN;
+		config->std_delay_drop = !!(tmp & MLX5_DELAY_DROP_STANDARD);
+		config->hp_delay_drop = !!(tmp & MLX5_DELAY_DROP_HAIRPIN);
 	} else {
 		DRV_LOG(WARNING, "%s: unknown parameter", key);
 		rte_errno = EINVAL;
-- 
2.27.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] net/mlx5: fix the delay drop bit set overflow
  2021-11-12 14:38 [PATCH] net/mlx5: fix the delay drop bit set overflow Bing Zhao
@ 2021-11-14 15:28 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2021-11-14 15:28 UTC (permalink / raw)
  To: Bing Zhao, Slava Ovsiienko, Matan Azrad; +Cc: dev

Hi,


> -----Original Message-----
> From: Bing Zhao <bingz@nvidia.com>
> Sent: Friday, November 12, 2021 4:39 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: [PATCH] net/mlx5: fix the delay drop bit set overflow
> 
> The attribute to record the global control of hairpin queues' delay drop was
> defined as a bit-field with one bit, and the intention was to reduce the
> memory overhead. In the meanwhile, the macro was defined as an
> enumerated value 0x2.
> 
> No matter what value inputted via devarg, the lowest bit was always zero
> and the higher bits would be ignored. For hairpin queues, the delay drop
> attribute couldn't be enabled.
> 
> With the commit, the double logical negation is used to fix this.
> 
> Fixes: febcac7b46cd ("net/mlx5: support Rx queue delay drop")
> 
> Signed-off-by: Bing Zhao <bingz@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-14 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 14:38 [PATCH] net/mlx5: fix the delay drop bit set overflow Bing Zhao
2021-11-14 15:28 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).