]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net/mlx5e: TC, add terminating actions
authorOz Shlomo <ozsh@nvidia.com>
Sat, 3 Dec 2022 22:13:26 +0000 (14:13 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 8 Dec 2022 21:04:26 +0000 (13:04 -0800)
Extend act api to identify actions that terminate action list.
Pre-step for terminating branching actions.

Signed-off-by: Oz Shlomo <ozsh@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/20221203221337.29267-5-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/accept.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.h
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/drop.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/goto.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred_nic.c

index 21aab96357b5bed1ee4497b237c2ab94e3acc047..a278f52d52b0691d79c7970b5410ba3a13309709 100644 (file)
@@ -28,4 +28,5 @@ tc_act_parse_accept(struct mlx5e_tc_act_parse_state *parse_state,
 struct mlx5e_tc_act mlx5e_tc_act_accept = {
        .can_offload = tc_act_can_offload_accept,
        .parse_action = tc_act_parse_accept,
+       .is_terminating_action = true,
 };
index 3337241cfd84c270bed5f6ad2bb826e9e7bac958..eba0c86989263f167fed61f897fc02e9411ad771 100644 (file)
@@ -11,7 +11,7 @@ static struct mlx5e_tc_act *tc_acts_fdb[NUM_FLOW_ACTIONS] = {
        [FLOW_ACTION_DROP] = &mlx5e_tc_act_drop,
        [FLOW_ACTION_TRAP] = &mlx5e_tc_act_trap,
        [FLOW_ACTION_GOTO] = &mlx5e_tc_act_goto,
-       [FLOW_ACTION_REDIRECT] = &mlx5e_tc_act_mirred,
+       [FLOW_ACTION_REDIRECT] = &mlx5e_tc_act_redirect,
        [FLOW_ACTION_MIRRED] = &mlx5e_tc_act_mirred,
        [FLOW_ACTION_REDIRECT_INGRESS] = &mlx5e_tc_act_redirect_ingress,
        [FLOW_ACTION_VLAN_PUSH] = &mlx5e_tc_act_vlan,
index e1570ff056ae7aa128a78817ad7de38f3bad1514..8ede4490228411ca8e0fe1c49256a43ccae11c36 100644 (file)
@@ -60,6 +60,8 @@ struct mlx5e_tc_act {
 
        int (*stats_action)(struct mlx5e_priv *priv,
                            struct flow_offload_action *fl_act);
+
+       bool is_terminating_action;
 };
 
 struct mlx5e_tc_flow_action {
@@ -81,6 +83,7 @@ extern struct mlx5e_tc_act mlx5e_tc_act_vlan_mangle;
 extern struct mlx5e_tc_act mlx5e_tc_act_mpls_push;
 extern struct mlx5e_tc_act mlx5e_tc_act_mpls_pop;
 extern struct mlx5e_tc_act mlx5e_tc_act_mirred;
+extern struct mlx5e_tc_act mlx5e_tc_act_redirect;
 extern struct mlx5e_tc_act mlx5e_tc_act_mirred_nic;
 extern struct mlx5e_tc_act mlx5e_tc_act_ct;
 extern struct mlx5e_tc_act mlx5e_tc_act_sample;
index dd025a95c439280f4c782b564ef4c38a5605e4fd..7d16aeabb119970c8ec4c7c4a1ff2a9c2995a164 100644 (file)
@@ -27,4 +27,5 @@ tc_act_parse_drop(struct mlx5e_tc_act_parse_state *parse_state,
 struct mlx5e_tc_act mlx5e_tc_act_drop = {
        .can_offload = tc_act_can_offload_drop,
        .parse_action = tc_act_parse_drop,
+       .is_terminating_action = true,
 };
index 25174f68613ede4943c9ede955309963f726b893..0923e6db2d0a33028dbf24b870ac672b0000ab80 100644 (file)
@@ -121,4 +121,5 @@ struct mlx5e_tc_act mlx5e_tc_act_goto = {
        .can_offload = tc_act_can_offload_goto,
        .parse_action = tc_act_parse_goto,
        .post_parse = tc_act_post_parse_goto,
+       .is_terminating_action = true,
 };
index 4ac7de3f6afa37d5974ae66a4b6682fcef5b7f35..78c427b38048d058f1578e4399e76aa23b72a6d7 100644 (file)
@@ -334,4 +334,11 @@ tc_act_parse_mirred(struct mlx5e_tc_act_parse_state *parse_state,
 struct mlx5e_tc_act mlx5e_tc_act_mirred = {
        .can_offload = tc_act_can_offload_mirred,
        .parse_action = tc_act_parse_mirred,
+       .is_terminating_action = false,
+};
+
+struct mlx5e_tc_act mlx5e_tc_act_redirect = {
+       .can_offload = tc_act_can_offload_mirred,
+       .parse_action = tc_act_parse_mirred,
+       .is_terminating_action = true,
 };
index 90b4c1b34776b70b7676e87f3c0d928eb82481c0..7f409692b18f497aa53aec6847fc147d742431b8 100644 (file)
@@ -48,4 +48,5 @@ tc_act_parse_mirred_nic(struct mlx5e_tc_act_parse_state *parse_state,
 struct mlx5e_tc_act mlx5e_tc_act_mirred_nic = {
        .can_offload = tc_act_can_offload_mirred_nic,
        .parse_action = tc_act_parse_mirred_nic,
+       .is_terminating_action = true,
 };