mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 20:46:48 +02:00
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: 6ddac26cf7 ("net/mlx5e: Add support to modify hardware flow meter parameters")
Acked-by: Saeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/ecb00ddd1197b4f8a4882090206bd2eee1eb8b5b.1657005206.git.pabeni@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
a94afe18ac
commit
55ae465222
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
|
||||
// Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
#include <linux/math64.h>
|
||||
#include "lib/aso.h"
|
||||
#include "en/tc/post_act.h"
|
||||
#include "meter.h"
|
||||
|
|
@ -61,7 +62,7 @@ mlx5e_flow_meter_cir_calc(u64 cir, u8 *man, u8 *exp)
|
|||
m = cir << e;
|
||||
if ((s64)m < 0) /* overflow */
|
||||
break;
|
||||
m /= MLX5_CONST_CIR;
|
||||
m = div64_u64(m, MLX5_CONST_CIR);
|
||||
if (m > 0xFF) /* man width 8 bit */
|
||||
continue;
|
||||
_cir = MLX5_CALC_CIR(m, e);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user