Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx5: Enable setting minimum inline header mode for VFs

Implement the low-level part of the PF side in setting minimum
inline header mode for VFs.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Hadar Hen Zion and committed by
Leon Romanovsky
9def7121 2974ab6e

+23 -1
+20
drivers/net/ethernet/mellanox/mlx5/core/vport.c
··· 125 125 } 126 126 EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_min_inline); 127 127 128 + int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev, 129 + u16 vport, u8 min_inline) 130 + { 131 + u32 in[MLX5_ST_SZ_DW(modify_nic_vport_context_in)] = {0}; 132 + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in); 133 + void *nic_vport_ctx; 134 + 135 + MLX5_SET(modify_nic_vport_context_in, in, 136 + field_select.min_inline, 1); 137 + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); 138 + MLX5_SET(modify_nic_vport_context_in, in, other_vport, 1); 139 + 140 + nic_vport_ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, 141 + in, nic_vport_context); 142 + MLX5_SET(nic_vport_context, nic_vport_ctx, 143 + min_wqe_inline_mode, min_inline); 144 + 145 + return mlx5_modify_nic_vport_context(mdev, in, inlen); 146 + } 147 + 128 148 int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev, 129 149 u16 vport, u8 *addr) 130 150 {
+1 -1
include/linux/mlx5/mlx5_ifc.h
··· 4724 4724 u8 reserved_at_0[0x16]; 4725 4725 u8 node_guid[0x1]; 4726 4726 u8 port_guid[0x1]; 4727 - u8 reserved_at_18[0x1]; 4727 + u8 min_inline[0x1]; 4728 4728 u8 mtu[0x1]; 4729 4729 u8 change_event[0x1]; 4730 4730 u8 promisc[0x1];
+2
include/linux/mlx5/vport.h
··· 45 45 u16 vport, u8 *addr); 46 46 void mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev, 47 47 u8 *min_inline); 48 + int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev, 49 + u16 vport, u8 min_inline); 48 50 int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev, 49 51 u16 vport, u8 *addr); 50 52 int mlx5_query_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 *mtu);