Skip to content

Commit 023d2a4

Browse files
dtatuleaSaeed Mahameed
authored andcommitted
net/mlx5e: SHAMPO, Fix overflow of hd_per_wq
When having larger RQ sizes and small MTUs sizes, the hd_per_wq variable can overflow. Like in the following case: $> ethtool --set-ring eth1 rx 8192 $> ip link set dev eth1 mtu 144 $> ethtool --features eth1 rx-gro-hw on ... yields in dmesg: mlx5_core 0000:08:00.1: mlx5_cmd_out_err:808:(pid 194797): CREATE_MKEY(0x200) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x3bf6f), err(-22) because hd_per_wq is 64K which overflows to 0 and makes the command fail. This patch increases the variable size to 32 bit. Fixes: 99be561 ("net/mlx5e: SHAMPO, Re-enable HW-GRO") Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent d15525f commit 023d2a4

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ struct mlx5e_shampo_hd {
627627
struct mlx5e_dma_info *info;
628628
struct mlx5e_frag_page *pages;
629629
u16 curr_page_index;
630-
u16 hd_per_wq;
630+
u32 hd_per_wq;
631631
u16 hd_per_wqe;
632632
unsigned long *bitmap;
633633
u16 pi;

0 commit comments

Comments
 (0)