net/mlx5: Add support for COPY steering action
authorHuy Nguyen <huyn@mellanox.com>
Fri, 24 Apr 2020 19:45:02 +0000 (12:45 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 28 Apr 2020 19:44:44 +0000 (12:44 -0700)
Add COPY type to modify_header action. IPsec feature is the first
feature that needs COPY steering action.

Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Signed-off-by: Raed Salem <raeds@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/hw/mlx5/flow.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/esw/chains.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c
include/linux/mlx5/mlx5_ifc.h

index 862b7bf..69cb7e6 100644 (file)
@@ -427,7 +427,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_FLOW_ACTION_CREATE_MODIFY_HEADER)(
 
        num_actions = uverbs_attr_ptr_get_array_size(
                attrs, MLX5_IB_ATTR_CREATE_MODIFY_HEADER_ACTIONS_PRM,
-               MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto));
+               MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto));
        if (num_actions < 0)
                return num_actions;
 
@@ -648,7 +648,7 @@ DECLARE_UVERBS_NAMED_METHOD(
                        UA_MANDATORY),
        UVERBS_ATTR_PTR_IN(MLX5_IB_ATTR_CREATE_MODIFY_HEADER_ACTIONS_PRM,
                           UVERBS_ATTR_MIN_SIZE(MLX5_UN_SZ_BYTES(
-                                  set_action_in_add_action_in_auto)),
+                                  set_add_copy_action_in_auto)),
                           UA_MANDATORY,
                           UA_ALLOC_AND_COPY),
        UVERBS_ATTR_CONST_IN(MLX5_IB_ATTR_CREATE_MODIFY_HEADER_FT_TYPE,
index ad3e3a6..91464f7 100644 (file)
@@ -385,7 +385,7 @@ mlx5_tc_ct_entry_create_nat(struct mlx5_tc_ct_priv *ct_priv,
        char *modact;
        int err, i;
 
-       action_size = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto);
+       action_size = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto);
 
        flow_action_for_each(i, act, flow_action) {
                switch (act->id) {
index 88c0e46..12c5ca5 100644 (file)
@@ -61,7 +61,7 @@
 #include "lib/geneve.h"
 #include "diag/en_tc_tracepoint.h"
 
-#define MLX5_MH_ACT_SZ MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)
+#define MLX5_MH_ACT_SZ MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)
 
 struct mlx5_nic_flow_attr {
        u32 action;
@@ -2660,7 +2660,7 @@ static int offload_pedit_fields(struct mlx5e_priv *priv,
        set_vals = &hdrs[0].vals;
        add_vals = &hdrs[1].vals;
 
-       action_size = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto);
+       action_size = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto);
 
        for (i = 0; i < ARRAY_SIZE(fields); i++) {
                bool skip;
@@ -2793,7 +2793,7 @@ int alloc_mod_hdr_actions(struct mlx5_core_dev *mdev,
        if (mod_hdr_acts->num_actions < mod_hdr_acts->max_actions)
                return 0;
 
-       action_size = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto);
+       action_size = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto);
 
        max_hw_actions = mlx5e_flow_namespace_max_modify_action(mdev,
                                                                namespace);
index 0290010..d5bf908 100644 (file)
@@ -274,7 +274,7 @@ mlx5_esw_chains_destroy_fdb_table(struct mlx5_eswitch *esw,
 static int
 create_fdb_chain_restore(struct fdb_chain *fdb_chain)
 {
-       char modact[MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)];
+       char modact[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)];
        struct mlx5_eswitch *esw = fdb_chain->esw;
        struct mlx5_modify_hdr *mod_hdr;
        u32 index;
index dc098bb..703f307 100644 (file)
@@ -1490,7 +1490,7 @@ static void esw_destroy_restore_table(struct mlx5_eswitch *esw)
 
 static int esw_create_restore_table(struct mlx5_eswitch *esw)
 {
-       u8 modact[MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)] = {};
+       u8 modact[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)] = {};
        int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
        struct mlx5_flow_table_attr ft_attr = {};
        struct mlx5_core_dev *dev = esw->dev;
@@ -1900,7 +1900,7 @@ static int esw_vport_ingress_prio_tag_config(struct mlx5_eswitch *esw,
 static int esw_vport_add_ingress_acl_modify_metadata(struct mlx5_eswitch *esw,
                                                     struct mlx5_vport *vport)
 {
-       u8 action[MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto)] = {};
+       u8 action[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)] = {};
        struct mlx5_flow_act flow_act = {};
        int err = 0;
        u32 key;
index 304d1e4..1a8e826 100644 (file)
@@ -791,7 +791,7 @@ static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
                return -EOPNOTSUPP;
        }
 
-       actions_size = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto) * num_actions;
+       actions_size = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto) * num_actions;
        inlen = MLX5_ST_SZ_BYTES(alloc_modify_header_context_in) + actions_size;
 
        in = kzalloc(inlen, GFP_KERNEL);
index 3b3f5b9..8887b24 100644 (file)
@@ -576,7 +576,7 @@ static int mlx5_cmd_dr_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
        struct mlx5dr_action *action;
        size_t actions_sz;
 
-       actions_sz = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto) *
+       actions_sz = MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto) *
                num_actions;
        action = mlx5dr_action_create_modify_header(dr_domain, 0,
                                                    actions_sz,
index 6fa2491..3ad2c51 100644 (file)
@@ -5670,9 +5670,9 @@ struct mlx5_ifc_copy_action_in_bits {
        u8         reserved_at_38[0x8];
 };
 
-union mlx5_ifc_set_action_in_add_action_in_auto_bits {
-       struct mlx5_ifc_set_action_in_bits set_action_in;
-       struct mlx5_ifc_add_action_in_bits add_action_in;
+union mlx5_ifc_set_add_copy_action_in_auto_bits {
+       struct mlx5_ifc_set_action_in_bits  set_action_in;
+       struct mlx5_ifc_add_action_in_bits  add_action_in;
        struct mlx5_ifc_copy_action_in_bits copy_action_in;
        u8         reserved_at_0[0x40];
 };
@@ -5746,7 +5746,7 @@ struct mlx5_ifc_alloc_modify_header_context_in_bits {
        u8         reserved_at_68[0x10];
        u8         num_of_actions[0x8];
 
-       union mlx5_ifc_set_action_in_add_action_in_auto_bits actions[0];
+       union mlx5_ifc_set_add_copy_action_in_auto_bits actions[0];
 };
 
 struct mlx5_ifc_dealloc_modify_header_context_out_bits {