Skip to content

Commit 99be561

Browse files
zackyoraykuba-moo
authored andcommitted
net/mlx5e: SHAMPO, Re-enable HW-GRO
Add back HW-GRO to the reported features. As the current implementation of HW-GRO uses KSMs with a specific fixed buffer size (256B) to map its headers buffer, we reported the feature only if the NIC is supporting KSM and the minimum value for buffer size is below the requested one. iperf3 bandwidth comparison: +---------+--------+--------+-----------+ | streams | SW GRO | HW GRO | Unit | |---------+--------+--------+-----------| | 1 | 36 | 42 | Gbits/sec | | 4 | 34 | 39 | Gbits/sec | | 8 | 31 | 35 | Gbits/sec | +---------+--------+--------+-----------+ A downstream patch will add skb fragment coalescing which will improve performance considerably. Benchmark details: VM based setup CPU: Intel(R) Xeon(R) Platinum 8380 CPU, 24 cores NIC: ConnectX-7 100GbE iperf3 and irq running on same CPU over a single receive queue Signed-off-by: Yoray Zack <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 758191c commit 99be561

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,27 @@
7474
#include "lib/devcom.h"
7575
#include "lib/sd.h"
7676

77+
static bool mlx5e_hw_gro_supported(struct mlx5_core_dev *mdev)
78+
{
79+
if (!MLX5_CAP_GEN(mdev, shampo))
80+
return false;
81+
82+
/* Our HW-GRO implementation relies on "KSM Mkey" for
83+
* SHAMPO headers buffer mapping
84+
*/
85+
if (!MLX5_CAP_GEN(mdev, fixed_buffer_size))
86+
return false;
87+
88+
if (!MLX5_CAP_GEN_2(mdev, min_mkey_log_entity_size_fixed_buffer_valid))
89+
return false;
90+
91+
if (MLX5_CAP_GEN_2(mdev, min_mkey_log_entity_size_fixed_buffer) >
92+
MLX5E_SHAMPO_LOG_HEADER_ENTRY_SIZE)
93+
return false;
94+
95+
return true;
96+
}
97+
7798
bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev, u8 page_shift,
7899
enum mlx5e_mpwrq_umr_mode umr_mode)
79100
{
@@ -5331,6 +5352,11 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
53315352
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
53325353
netdev->hw_features |= NETIF_F_HW_VLAN_STAG_TX;
53335354

5355+
if (mlx5e_hw_gro_supported(mdev) &&
5356+
mlx5e_check_fragmented_striding_rq_cap(mdev, PAGE_SHIFT,
5357+
MLX5E_MPWRQ_UMR_MODE_ALIGNED))
5358+
netdev->hw_features |= NETIF_F_GRO_HW;
5359+
53345360
if (mlx5e_tunnel_any_tx_proto_supported(mdev)) {
53355361
netdev->hw_enc_features |= NETIF_F_HW_CSUM;
53365362
netdev->hw_enc_features |= NETIF_F_TSO;

include/linux/mlx5/mlx5_ifc.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,8 +1526,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {
15261526
u8 ts_cqe_to_dest_cqn[0x1];
15271527
u8 reserved_at_b3[0x6];
15281528
u8 go_back_n[0x1];
1529-
u8 shampo[0x1];
1530-
u8 reserved_at_bb[0x5];
1529+
u8 reserved_at_ba[0x6];
15311530

15321531
u8 max_sgl_for_optimized_performance[0x8];
15331532
u8 log_max_cq_sz[0x8];
@@ -1744,7 +1743,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
17441743
u8 reserved_at_280[0x10];
17451744
u8 max_wqe_sz_sq[0x10];
17461745

1747-
u8 reserved_at_2a0[0x10];
1746+
u8 reserved_at_2a0[0xb];
1747+
u8 shampo[0x1];
1748+
u8 reserved_at_2ac[0x4];
17481749
u8 max_wqe_sz_rq[0x10];
17491750

17501751
u8 max_flow_counter_31_16[0x10];
@@ -2017,7 +2018,8 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {
20172018
u8 reserved_at_250[0x10];
20182019

20192020
u8 reserved_at_260[0x120];
2020-
u8 reserved_at_380[0x10];
2021+
u8 reserved_at_380[0xb];
2022+
u8 min_mkey_log_entity_size_fixed_buffer[0x5];
20212023
u8 ec_vf_vport_base[0x10];
20222024

20232025
u8 reserved_at_3a0[0x10];
@@ -2029,7 +2031,11 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {
20292031
u8 pcc_ifa2[0x1];
20302032
u8 reserved_at_3f1[0xf];
20312033

2032-
u8 reserved_at_400[0x400];
2034+
u8 reserved_at_400[0x1];
2035+
u8 min_mkey_log_entity_size_fixed_buffer_valid[0x1];
2036+
u8 reserved_at_402[0x1e];
2037+
2038+
u8 reserved_at_420[0x3e0];
20332039
};
20342040

20352041
enum mlx5_ifc_flow_destination_type {

0 commit comments

Comments
 (0)