Skip to content

Commit ec7cc38

Browse files
mosheshemesh2Saeed Mahameed
authored andcommitted
net/mlx5: Bridge, fix multicast packets sent to uplink
To enable multicast packets which are offloaded in bridge multicast offload mode to be sent also to uplink, FTE bit uplink_hairpin_en should be set. Add this bit to FTE for the bridge multicast offload rules. Fixes: 18c2916 ("net/mlx5: Bridge, snoop igmp/mld packets") Signed-off-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Gal Pressman <gal@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent cc80915 commit ec7cc38

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ mlx5_esw_bridge_mdb_flow_create(u16 esw_owner_vhca_id, struct mlx5_esw_bridge_md
8383
i++;
8484
}
8585

86+
rule_spec->flow_context.flags |= FLOW_CONTEXT_UPLINK_HAIRPIN_EN;
8687
rule_spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS;
8788
dmac_v = MLX5_ADDR_OF(fte_match_param, rule_spec->match_value, outer_headers.dmac_47_16);
8889
ether_addr_copy(dmac_v, entry->key.addr);
@@ -587,6 +588,7 @@ mlx5_esw_bridge_mcast_vlan_flow_create(u16 vlan_proto, struct mlx5_esw_bridge_po
587588
if (!rule_spec)
588589
return ERR_PTR(-ENOMEM);
589590

591+
rule_spec->flow_context.flags |= FLOW_CONTEXT_UPLINK_HAIRPIN_EN;
590592
rule_spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS;
591593

592594
flow_act.action |= MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT;
@@ -662,6 +664,7 @@ mlx5_esw_bridge_mcast_fwd_flow_create(struct mlx5_esw_bridge_port *port)
662664
dest.vport.flags = MLX5_FLOW_DEST_VPORT_VHCA_ID;
663665
dest.vport.vhca_id = port->esw_owner_vhca_id;
664666
}
667+
rule_spec->flow_context.flags |= FLOW_CONTEXT_UPLINK_HAIRPIN_EN;
665668
handle = mlx5_add_flow_rules(port->mcast.ft, rule_spec, &flow_act, &dest, 1);
666669

667670
kvfree(rule_spec);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
566566
fte->flow_context.flow_tag);
567567
MLX5_SET(flow_context, in_flow_context, flow_source,
568568
fte->flow_context.flow_source);
569+
MLX5_SET(flow_context, in_flow_context, uplink_hairpin_en,
570+
!!(fte->flow_context.flags & FLOW_CONTEXT_UPLINK_HAIRPIN_EN));
569571

570572
MLX5_SET(flow_context, in_flow_context, extended_destination,
571573
extended_dest);

include/linux/mlx5/fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ struct mlx5_flow_handle;
132132

133133
enum {
134134
FLOW_CONTEXT_HAS_TAG = BIT(0),
135+
FLOW_CONTEXT_UPLINK_HAIRPIN_EN = BIT(1),
135136
};
136137

137138
struct mlx5_flow_context {

include/linux/mlx5/mlx5_ifc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3576,7 +3576,7 @@ struct mlx5_ifc_flow_context_bits {
35763576
u8 action[0x10];
35773577

35783578
u8 extended_destination[0x1];
3579-
u8 reserved_at_81[0x1];
3579+
u8 uplink_hairpin_en[0x1];
35803580
u8 flow_source[0x2];
35813581
u8 encrypt_decrypt_type[0x4];
35823582
u8 destination_list_size[0x18];

0 commit comments

Comments
 (0)