net/mlx5e: Rename CHAIN_TO_REG to MAPPED_OBJ_TO_REG
authorPaul Blakey <paulb@nvidia.com>
Fri, 17 Feb 2023 22:36:19 +0000 (00:36 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 21 Feb 2023 00:46:10 +0000 (16:46 -0800)
This reg usage is always a mapped object, not necessarily
containing chain info.

Rename to properly convey what it stores.
This patch doesn't change any functionality.

Signed-off-by: Paul Blakey <paulb@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.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/en_tc.h
drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c

index f2c2c752bd1c345849d68245013feee7c3a4a2f9..558a776359af680e07fa48534fe3ace2bc8a7e66 100644 (file)
@@ -237,7 +237,7 @@ sample_modify_hdr_get(struct mlx5_core_dev *mdev, u32 obj_id,
        int err;
 
        err = mlx5e_tc_match_to_reg_set(mdev, mod_acts, MLX5_FLOW_NAMESPACE_FDB,
-                                       CHAIN_TO_REG, obj_id);
+                                       MAPPED_OBJ_TO_REG, obj_id);
        if (err)
                goto err_set_regc0;
 
index 2251f33c3865135f4a38c087fb7d9266dca73eb2..de751d08477053d3a8f46610c6ee5fb18961af51 100644 (file)
@@ -1875,7 +1875,7 @@ __mlx5_tc_ct_flow_offload(struct mlx5_tc_ct_priv *ct_priv,
        ct_flow->chain_mapping = chain_mapping;
 
        err = mlx5e_tc_match_to_reg_set(priv->mdev, pre_mod_acts, ct_priv->ns_type,
-                                       CHAIN_TO_REG, chain_mapping);
+                                       MAPPED_OBJ_TO_REG, chain_mapping);
        if (err) {
                ct_dbg("Failed to set chain register mapping");
                goto err_mapping;
index 3819d2bee6c2d2db4c3d2a568f78ff715d05bb24..2dd0bd54c3cd6a8ab722e201f2deeb447576530a 100644 (file)
@@ -109,7 +109,7 @@ struct mlx5e_tc_table {
 };
 
 struct mlx5e_tc_attr_to_reg_mapping mlx5e_tc_attr_to_reg_mappings[] = {
-       [CHAIN_TO_REG] = {
+       [MAPPED_OBJ_TO_REG] = {
                .mfield = MLX5_ACTION_IN_FIELD_METADATA_REG_C_0,
                .moffset = 0,
                .mlen = 16,
@@ -136,7 +136,7 @@ struct mlx5e_tc_attr_to_reg_mapping mlx5e_tc_attr_to_reg_mappings[] = {
         * into reg_b that is passed to SW since we don't
         * jump between steering domains.
         */
-       [NIC_CHAIN_TO_REG] = {
+       [NIC_MAPPED_OBJ_TO_REG] = {
                .mfield = MLX5_ACTION_IN_FIELD_METADATA_REG_B,
                .moffset = 0,
                .mlen = 16,
@@ -1605,7 +1605,7 @@ mlx5e_tc_offload_to_slow_path(struct mlx5_eswitch *esw,
                goto err_get_chain;
 
        err = mlx5e_tc_match_to_reg_set(esw->dev, &mod_acts, MLX5_FLOW_NAMESPACE_FDB,
-                                       CHAIN_TO_REG, chain_mapping);
+                                       MAPPED_OBJ_TO_REG, chain_mapping);
        if (err)
                goto err_reg_set;
 
index 6388444925cf56236ebcb03072ae5c436ed04db3..a46a74eb354d4e6c167ab4e4c78bafd4447c6d9d 100644 (file)
@@ -227,7 +227,7 @@ void mlx5e_tc_update_neigh_used_value(struct mlx5e_neigh_hash_entry *nhe);
 void mlx5e_tc_reoffload_flows_work(struct work_struct *work);
 
 enum mlx5e_tc_attr_to_reg {
-       CHAIN_TO_REG,
+       MAPPED_OBJ_TO_REG,
        VPORT_TO_REG,
        TUNNEL_TO_REG,
        CTSTATE_TO_REG,
@@ -236,7 +236,7 @@ enum mlx5e_tc_attr_to_reg {
        MARK_TO_REG,
        LABELS_TO_REG,
        FTEID_TO_REG,
-       NIC_CHAIN_TO_REG,
+       NIC_MAPPED_OBJ_TO_REG,
        NIC_ZONE_RESTORE_TO_REG,
        PACKET_COLOR_TO_REG,
 };
index df58cba37930aeb8b47a9f1a0b8079d60244e604..81ed91fee59b9bf103f54b76d590fadac1b6e80b 100644 (file)
@@ -214,7 +214,7 @@ create_chain_restore(struct fs_chain *chain)
        struct mlx5_eswitch *esw = chain->chains->dev->priv.eswitch;
        u8 modact[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)] = {};
        struct mlx5_fs_chains *chains = chain->chains;
-       enum mlx5e_tc_attr_to_reg chain_to_reg;
+       enum mlx5e_tc_attr_to_reg mapped_obj_to_reg;
        struct mlx5_modify_hdr *mod_hdr;
        u32 index;
        int err;
@@ -242,7 +242,7 @@ create_chain_restore(struct fs_chain *chain)
        chain->id = index;
 
        if (chains->ns == MLX5_FLOW_NAMESPACE_FDB) {
-               chain_to_reg = CHAIN_TO_REG;
+               mapped_obj_to_reg = MAPPED_OBJ_TO_REG;
                chain->restore_rule = esw_add_restore_rule(esw, chain->id);
                if (IS_ERR(chain->restore_rule)) {
                        err = PTR_ERR(chain->restore_rule);
@@ -253,7 +253,7 @@ create_chain_restore(struct fs_chain *chain)
                 * since we write the metadata to reg_b
                 * that is passed to SW directly.
                 */
-               chain_to_reg = NIC_CHAIN_TO_REG;
+               mapped_obj_to_reg = NIC_MAPPED_OBJ_TO_REG;
        } else {
                err = -EINVAL;
                goto err_rule;
@@ -261,12 +261,12 @@ create_chain_restore(struct fs_chain *chain)
 
        MLX5_SET(set_action_in, modact, action_type, MLX5_ACTION_TYPE_SET);
        MLX5_SET(set_action_in, modact, field,
-                mlx5e_tc_attr_to_reg_mappings[chain_to_reg].mfield);
+                mlx5e_tc_attr_to_reg_mappings[mapped_obj_to_reg].mfield);
        MLX5_SET(set_action_in, modact, offset,
-                mlx5e_tc_attr_to_reg_mappings[chain_to_reg].moffset);
+                mlx5e_tc_attr_to_reg_mappings[mapped_obj_to_reg].moffset);
        MLX5_SET(set_action_in, modact, length,
-                mlx5e_tc_attr_to_reg_mappings[chain_to_reg].mlen == 32 ?
-                0 : mlx5e_tc_attr_to_reg_mappings[chain_to_reg].mlen);
+                mlx5e_tc_attr_to_reg_mappings[mapped_obj_to_reg].mlen == 32 ?
+                0 : mlx5e_tc_attr_to_reg_mappings[mapped_obj_to_reg].mlen);
        MLX5_SET(set_action_in, modact, data, chain->id);
        mod_hdr = mlx5_modify_header_alloc(chains->dev, chains->ns,
                                           1, modact);