Skip to content

Commit 9def712

Browse files
hadarhenzionrleon
authored andcommitted
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 <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 2974ab6 commit 9def712

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,26 @@ void mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev,
125125
}
126126
EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_min_inline);
127127

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+
128148
int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev,
129149
u16 vport, u8 *addr)
130150
{

include/linux/mlx5/mlx5_ifc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4724,7 +4724,7 @@ struct mlx5_ifc_modify_nic_vport_field_select_bits {
47244724
u8 reserved_at_0[0x16];
47254725
u8 node_guid[0x1];
47264726
u8 port_guid[0x1];
4727-
u8 reserved_at_18[0x1];
4727+
u8 min_inline[0x1];
47284728
u8 mtu[0x1];
47294729
u8 change_event[0x1];
47304730
u8 promisc[0x1];

include/linux/mlx5/vport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev,
4545
u16 vport, u8 *addr);
4646
void mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev,
4747
u8 *min_inline);
48+
int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev,
49+
u16 vport, u8 min_inline);
4850
int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev,
4951
u16 vport, u8 *addr);
5052
int mlx5_query_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 *mtu);

0 commit comments

Comments
 (0)