Skip to content

Commit 58a606d

Browse files
maorgottliebSaeed Mahameed
authored andcommitted
net/mlx5: Introduce new uplink destination type
The uplink destination type should be used in rules to steer the packet to the uplink when the device is in steering based LAG mode. Signed-off-by: Maor Gottlieb <maorg@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent e7e2519 commit 58a606d

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ const char *parse_fs_dst(struct trace_seq *p,
235235
const char *ret = trace_seq_buffer_ptr(p);
236236

237237
switch (dst->type) {
238+
case MLX5_FLOW_DESTINATION_TYPE_UPLINK:
239+
trace_seq_printf(p, "uplink\n");
240+
break;
238241
case MLX5_FLOW_DESTINATION_TYPE_VPORT:
239242
trace_seq_printf(p, "vport=%u\n", dst->vport.num);
240243
break;

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,15 +577,21 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
577577
case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE:
578578
id = dst->dest_attr.ft->id;
579579
break;
580+
case MLX5_FLOW_DESTINATION_TYPE_UPLINK:
580581
case MLX5_FLOW_DESTINATION_TYPE_VPORT:
581-
id = dst->dest_attr.vport.num;
582582
MLX5_SET(dest_format_struct, in_dests,
583583
destination_eswitch_owner_vhca_id_valid,
584584
!!(dst->dest_attr.vport.flags &
585585
MLX5_FLOW_DEST_VPORT_VHCA_ID));
586586
MLX5_SET(dest_format_struct, in_dests,
587587
destination_eswitch_owner_vhca_id,
588588
dst->dest_attr.vport.vhca_id);
589+
if (type == MLX5_FLOW_DESTINATION_TYPE_UPLINK) {
590+
/* destination_id is reserved */
591+
id = 0;
592+
break;
593+
}
594+
id = dst->dest_attr.vport.num;
589595
if (extended_dest &&
590596
dst->dest_attr.vport.pkt_reformat) {
591597
MLX5_SET(dest_format_struct, in_dests,

include/linux/mlx5/mlx5_ifc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,7 @@ enum mlx5_flow_destination_type {
17661766
MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE = 0x1,
17671767
MLX5_FLOW_DESTINATION_TYPE_TIR = 0x2,
17681768
MLX5_FLOW_DESTINATION_TYPE_FLOW_SAMPLER = 0x6,
1769+
MLX5_FLOW_DESTINATION_TYPE_UPLINK = 0x8,
17691770

17701771
MLX5_FLOW_DESTINATION_TYPE_PORT = 0x99,
17711772
MLX5_FLOW_DESTINATION_TYPE_COUNTER = 0x100,

0 commit comments

Comments
 (0)