Skip to content

Commit

Permalink
net/mlx5: fix modify action with tunnel decapsulation
Browse files Browse the repository at this point in the history
[ upstream commit 9f71a29 ]

The driver splits the flow with sample action into two sub-flows,
sub prefix flow and sub suffix flow.

In the case of tunnel flow including a decap action, the driver should
translate the inner as outer for actions coming after the decap action.
In the case of flow splitting, the packet layers, used to detect the
attributes, are inherited from the prefix flow to the suffix flow but
the driver wrongly didn't handle the decap adjustment and the inner
layers didn't shift to the outer.

This patch adjusts the inherited layers in case of decap.

Fixes: 6e77151 ("net/mlx5: fix match information in meter")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
  • Loading branch information
jiaweiwsz authored and kevintraynor committed Oct 11, 2022
1 parent ccdfdba commit 9412d61
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/mlx5/mlx5_flow_dv.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr,
* have the user defined items as the flow is split.
*/
if (layers) {
if (tunnel_decap) {
/*
* If decap action before modify, it means the driver
* should take the inner as outer for the modify actions.
*/
layers = ((layers >> 6) & MLX5_FLOW_LAYER_OUTER);
}
if (layers & MLX5_FLOW_LAYER_OUTER_L3_IPV4)
attr->ipv4 = 1;
else if (layers & MLX5_FLOW_LAYER_OUTER_L3_IPV6)
Expand Down

0 comments on commit 9412d61

Please sign in to comment.