Commit 55ae4652 authored by Paolo Abeni's avatar Paolo Abeni

net/mlx5: fix 32bit build

We can't use the division operator on 64 bits integers, that breaks
32 bits build. Instead use the relevant helper.

Fixes: 6ddac26c ("net/mlx5e: Add support to modify hardware flow meter parameters")
Acked-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/ecb00ddd1197b4f8a4882090206bd2eee1eb8b5b.1657005206.git.pabeni@redhat.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent a94afe18
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
// Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. // Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#include <linux/math64.h>
#include "lib/aso.h" #include "lib/aso.h"
#include "en/tc/post_act.h" #include "en/tc/post_act.h"
#include "meter.h" #include "meter.h"
...@@ -61,7 +62,7 @@ mlx5e_flow_meter_cir_calc(u64 cir, u8 *man, u8 *exp) ...@@ -61,7 +62,7 @@ mlx5e_flow_meter_cir_calc(u64 cir, u8 *man, u8 *exp)
m = cir << e; m = cir << e;
if ((s64)m < 0) /* overflow */ if ((s64)m < 0) /* overflow */
break; break;
m /= MLX5_CONST_CIR; m = div64_u64(m, MLX5_CONST_CIR);
if (m > 0xFF) /* man width 8 bit */ if (m > 0xFF) /* man width 8 bit */
continue; continue;
_cir = MLX5_CALC_CIR(m, e); _cir = MLX5_CALC_CIR(m, e);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment