]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net/mlx5e: Accept action skbedit in the tc actions list
authorAriel Levkovich <lariel@nvidia.com>
Mon, 11 Jan 2021 19:42:59 +0000 (21:42 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:54:28 +0000 (10:54 +0200)
BugLink: https://bugs.launchpad.net/bugs/1983498
Setting the skb packet type field to host is usually
done when performing forwarding to ingress device.

This is required since the receive handling that is used
by the redirect to ingress action checks whether the packet
doesn't belong to this host and drops the packet in such case.

In order to be able to offload action redirect ingress, tc offload
code needs to accept the skbedit ptype action as well.

There's no special handling in HW for such action since it will
be followed by a redirect action and therefore, this code
only allows us to accept such action in the actions list but
not performing anything specific in HW for it.

Signed-off-by: Ariel Levkovich <lariel@nvidia.com>
Reviewed-by: Paul Blakey <paulb@nvidia.com>
Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
(cherry picked from commit dbac71f22954276633e525f958994f84a7bd303f)
Signed-off-by: Zachary Tahenakos <zachary.tahenakos@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index 95a9c1156eee4c2543d5aa68f71823ed60b84e66..9dbde60326e8837d25f3a5f03f6daa36a2d0eb71 100644 (file)
@@ -3886,6 +3886,13 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
                                MLX5_FLOW_CONTEXT_ACTION_COUNT;
                        attr->flags |= MLX5_ESW_ATTR_FLAG_ACCEPT;
                        break;
+               case FLOW_ACTION_PTYPE:
+                       if (act->ptype != PACKET_HOST) {
+                               NL_SET_ERR_MSG_MOD(extack,
+                                                  "skbedit ptype is only supported with type host");
+                               return -EOPNOTSUPP;
+                       }
+                       break;
                case FLOW_ACTION_DROP:
                        action |= MLX5_FLOW_CONTEXT_ACTION_DROP |
                                  MLX5_FLOW_CONTEXT_ACTION_COUNT;